SQL Server(localdb)\ v11.0的说明 [英] SQL Server (localdb)\v11.0 explained

查看:297
本文介绍了SQL Server(localdb)\ v11.0的说明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在关注代码优先"到现有数据库教程,并注意到它建议连接到(localdb)\v11.0用于学习目的.我尝试使用SQL Management Studio连接到它,并且它正常工作.但是,当我还原数据库备份后,它在用户目录中创建了一个[DatabaseName].mdf文件.

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. 什么是(localdb)\v11.0?它使用我的SQL Express还是SQL Compact?
  2. 它仅支持存储在.mdf文件中的数据库吗?
  3. 除了用户的文件夹外,如何指定还原路径?
  4. 它有什么一般用途(仅用于学习目的)?
  5. 在哪里可以找到有关这种数据库的更多信息?
  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?

推荐答案

    SQL Server 2012 CTP3中引入了
  1. LocalDB.它基本上是SQL Express的新版本,具有相同的功能,专用于开发人员.因此,您无需安装任何SQL Server.如果您已经安装了SQL 2012或Visual Studio 11,则您已经拥有了它,并且它可以在.Net 4或更高版本上运行.如果您使用的是Visual Studio 11,并且一直在使用新的EntityFramework和MVC,则可以在默认连接字符串上看到它. ()

  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)

MDF是SQL Server数据库文件的默认扩展名. (日志文件为LDF)另请参见此问题.

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

您可以使用MSDN

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

LocalDB供开发人员使用,请参阅第1点.

LocalDB is intended for developers, see point 1.

SQL Server Express博客中有一篇有关LocalDB的信息丰富的帖子

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

这篇关于SQL Server(localdb)\ v11.0的说明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆