How to Create a LocalDB database and database instance
LocalDB is a new feature of SQL Server 2012. It is a lightweight database tailored for developers. The following describes how to use it.
How to Create a LocalDB database:
Open the Server resource manager, right-click "Data Connection" to create a new SQL Server database, and enter (LocalDB) \ v11.0 in the Server name to connect to the v11.0 instance.
Create a new database named "Work" and click "OK" to create the database.
Modify the database connection string in the configuration file of the project.
<ConnectionStrings>
<Add name = "WorkDatabase" connectionString = "Data Source = (localDB) \ v11.0; Initial Catalog = Work; Integrated Security = True;"/>
</ConnectionStrings>
You can also use sqllocaldb.exe to create a database instance.
This Program is generally located in the following path: C: \ Program Files \ Microsoft SQL Server \ 110 \ Tools \ Binn \ SqlLocalDB.exe
Create a Test database instance:
SqlLocalDB.exe create Test
Start the Test database instance:
SqlLocalDB.exe start Test
Stop the Test database instance:
SqlLocalDB.exe stop Test
Display the Test database instance information:
SqlLocalDB.exe info Test
Show all database instance information:
SqlLocalDB.exe info
This article permanently updates the link address: