상세 컨텐츠

본문 제목

SQL Server 2012 Express - LocalDB

DataBase/SQL Server

by 탑~! 2012. 5. 17. 15:27

본문

 

Reference

http://msdn.microsoft.com/en-us/library/hh510202.aspx

 

다운로드

http://www.microsoft.com/downloads/ko-kr/details.aspx?FamilyId=c3a54822-f858-494a-9d74-b811e29179e7&displaylang=ko

 

SqlLocaDBUtility

http://msdn.microsoft.com/en-us/library/hh212961.aspx

 

 

 

 

 

Updated 2011-11-11: Added a link to the post on how LocalDB handles database file locations.

Updated 2012-01-03: Clarified that only SSMS from SQL Server 2012 (or newer) will work with the .NET 4 Update 4.0.2, since earlier SSMS versions are using .NET 3.5.

.NET Framework 4 Update 4.0.2

.NET team has just released Update 4.0.2 for .NET Framework 4. This update enables connecting to SQL Server Express LocalDB via System.Data.SqlClient provider.

.NET Framework 4 Update 4.0.2 can be downloaded from http://support.microsoft.com/kb/2544514

Does this work?

Well, let's give it a try!

We start by installing SQL Server 2012 Management Studio RC0 (SSMS) and LocalDB together with .NET 4. The version of SSMS is important as earlier versions are using .NET 3.5 and currently only .NET 4 can be updated to understand LocalDB connection strings. Next we update .NET 4 to 4.0.2 (hey, no reboot in my case!). Then fire up SSMS. When prompted for the server address we specify "(localdb)\v11.0", like this:

Clicking Connect and … (drum roll please!) …

Success!

Does it really work?

OK, so we confirmed SSMS connects to LocalDB. Which is great, but how about doing something more useful for a developer? The next logical step would be to create a database. We know the drill -- right-click the Databases node in Object Explorer and select New Database. So far, so good. After typing in the name of the new database (in my case LocalDBTest) we are ready to hit OK...

Clicking OK and ... we hit an error!

 

This is obviously a bug, but there are at least two reasons we shouldn't panic. First, the bug has an easy workaround that we're going to use very, very soon. Second, it points to an important characteristic of the way LocalDB handles database files. I will explain it in more detail in the next post, but for now let's get back to LocalDB and creating our database.

To work around this problem we need to explicitly specify the folder for the database files. For the lack of a better location let's just put them into My Documents, like this:

This time clicking OK creates the database without any problems.

 

출처 : http://blogs.msdn.com/b/sqlexpress/archive/2011/10/27/net-framework-4-now-supports-localdb.aspx

'DataBase > SQL Server' 카테고리의 다른 글

트랜잭션 로그 자르기  (0) 2012.12.24
SQL Server 2012 LocalDB 기능소개  (0) 2012.05.17
컬럼에 한글 포함여부 검사  (0) 2012.05.15
검색쿼리  (0) 2012.05.04
불특정 로우 추출하기  (0) 2012.04.02

관련글 더보기