Ext.: http://www.csdn.net/article/2012-03-30/313753
With the release of SQL Server 2012, SQL Server LocalDB jumped into our eyes. SQL Server LocalDB is a lightweight, easy-to-use database.
SQL Server LOCALDB maximizes your database management effort so developers can focus on developing database applications.
Manage LocalDB using the SQLLOCALDB command line
For ease of management, LOCALDB provides a command-line-based database management tool, SqlLocalDB.exe. Here is the path to the SqlLocalDB.exe:
- %ProgramFiles%\Microsoft SQL Server\110\tools\binn
We can run SqlLocalDB.exe on the cmd command line of the Windows operating system:
- Cd%programfiles%\microsoft SQL Server\110\tools\binn
- SqlLocalDB.exe/?
Figure 1:sqllocaldb-?
Sqllocaldb use a space as a delimiter, so if the instance name contains spaces or other special characters, we need to quote them in quotation marks. For example:
- SQLLOCALDB create "My LocalDB Instance"
An administrator or developer can create an LOCALDB instance using the Create option, and the-s option will launch the instance after the instance is created. For example:
- SQLLOCALDB create "Mylocaldb" 11.0-s
You can view the status information for the MYLOCALDB instance using the following command:
- SQLLOCALDB Info "Mylocaldb"
The command returns the following information:
Figure two: Sqllocaldb info mylocaldb
To start and stop an LOCALDB instance:
- Sqllocaldb start "Mylocaldb"
- Sqllocaldb Stop "Mylocaldb"
To delete a LocalDB instance:
- SQLLOCALDB Delete "Mylocaldb"
The above is a brief summary of the use of the SqlLocalDB.exe command-line utility to manage LocalDB, and more features to be explored by the reader, remember to ask for help with the SqlLocalDB.exe/? command.
Use SQL Server Management Studio (SSMS) to manage LocalDB
Reading here, are you inspired to find a way to manage localdb with SQL Server Management Studio (SSMS)? Yes, just use "instance pipe name"!
First, let's take a closer look at the LocalDB instance information above, and note the "instance named pipe Name" item.
Then, in SQL Server Management Studio (SSMS), click "Connect" | DB instance, in Server name, enter the instance pipeline name:
Figure 3: Connecting to the server
Finally, select "Windows Authentication" and click "Connect":
Figure 4:sql Server Management Stdio
Wish your database a pleasant trip! If you have questions, please share them with me in the comments. (Computer/compile)
SQL Server LocalDB Management Tour (RPM)