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 can maximize your database management effort so developers can focus on developing database applications.
Managing LocalDB using the SQLLOCALDB command line
For ease of management, LOCALDB provides a command line based database management tool SqlLocalDB.exe. The following is the SqlLocalDB.exe path:
%programfiles%\microsoft SQL Server\110\tools\binn
We can run SqlLocalDB.exe on the Windows operating system's CMD command line:
Cd%programfiles%\microsoft SQL server\110\tools\binn SqlLocalDB.exe/?
Figure 1:sqllocaldb-?
Sqllocaldb is delimited by a space, so if the instance name contains spaces or other special characters, we need to quote them. 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 start the instance after the instance is created. For example:
sqllocaldb Create "mylocaldb" 11.0-s
You can view the status information for a MYLOCALDB instance using the following command:
sqllocaldb Info "mylocaldb"
The command returns the following information:
Figure II: SQLLOCALDB info mylocaldb
Start, stop LocalDB instance:
sqllocaldb Start "mylocaldb" Sqllocaldb Stop "mylocaldb"
Delete LocalDB instance:
sqllocaldb Delete "Mylocaldb"
The above use SqlLocalDB.exe command-line utility to manage the localdb of a brief summary, more features have to be found in the reader's own to dig, remember to use the SqlLocalDB.exe/command to ask for help.
Using SQL Server Management Studio (SSMS) Management LocalDB
Reading here, have you been inspired to find a way to manage localdb with SQL Server Management Studio (SSMS)? Yes, using the "Instance pipe name"!
First, we take a closer look at the LocalDB instance information above, and note "instance named pipe name".
Then, in SQL Server Management Studio (SSMS), tap Connect | Database instance, enter the instance pipe name in server name as shown in the figure:
Figure 3: Connecting to the server
Finally, select Windows Authentication and click Connect:
Figure 4:sql Server Management Stdio
Wish you a pleasant trip to the database! If you have any questions, please share them with me in the comments.
(Responsible editor: The good of the Legacy)