How to Create a LocalDB database and database instance

Source: Internet
Author: User

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:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.