I wonder if it is possible to change default location of (LocalDB)
. When you create it with SqlLocalDB.exe
default location is
C:\Users\userId\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances\MyDB
And I believe this path is used in (LocalDB)
in connection strings (auto generated by creator of *.dbml
files):
<connectionStrings>
<add name="MyApp.Properties.Settings.MyConnectionString"
connectionString="Data Source=**(LocalDB)**\MyDB;Initial Catalog=sthDB;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
The system database files for the database are stored in the local AppData path, which is normally hidden. For example, C:\Users\<user>\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances\LocalDBApp1\ .
ldf files to another drive (e.g. F:\Databases\). On the SQL Studio, right-click the Databases and click Attach. Under Databases to attach, click Add. Browse for the Database file (.
You can't change the default, but you can change it for every database you create:
create database foo on (name='foo', filename='c:\DBs\foo.mdf')
http://blogs.msdn.com/b/sqlexpress/archive/2011/10/28/localdb-where-is-my-database.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With