SQL Server (localdb)\v11.0 explained

跟風遠走 提交于 2019-11-26 11:55:14

问题


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:

  1. What is a (localdb)\\v11.0? Does it uses my SQL Express or SQL Compact?
  2. Does it support only databases stored in .mdf files?
  3. How can I specify path for my restore other than my user\'s folder?
  4. What general purposes does it serve (is it for learning purposes only)?
  5. Where can I find more info about this kind of database?

回答1:


  1. 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. (Source)

  2. MDF is the default extension for SQL Server database files. (Log files are LDF) Also see this question.

  3. You can restore to a specific folder by using RESTORE DATABASE WITH MOVE as documented on MSDN here.

  4. LocalDB is intended for developers, see point 1.

  5. The SQL Server Express blog has an informative post about LocalDB here.



来源:https://stackoverflow.com/questions/18780941/sql-server-localdb-v11-0-explained

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!