I'm following Code First to an Existing Database tutorial and noticed that it suggested to connect to (localdb)\v11.0
in learning purposes. I've tried to connect to it using my SQL Management Studio and it worked. But when I've restored a DB backup it created an [DatabaseName].mdf
file in my user's directory.
I'm quite surprised and have following questions:
(localdb)\v11.0
? Does it uses my SQL Express or SQL Compact?.mdf
files?LocalDB was introduced in SQL Server 2012 CTP3. It’s basically a new version of SQL Express, with same functionality, dedicated to developers. So you don’t need to install any SQL server. If you have installed SQL 2012 or Visual Studio 11 then you already have it, and it runs over .Net 4 or higher. If you are using Visual Studio 11 and have been playing with the new EntityFramework and MVC, you can see it on the default connection string.
MDF is the default extension for SQL Server database files. (Log files are LDF) Also see this question.
You can restore to a specific folder by using RESTORE DATABASE WITH MOVE
as documented on MSDN here.
LocalDB is intended for developers, see point 1.
The SQL Server Express blog has an informative post about LocalDB here.
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