Visual Studio 2013 Database Project: Working the Project LocalDbs
Visual Studio (VS) has evolved much to what it is capable of today for database development and deployment. With the addition of a much better table create facility Visual Studio is the development tool of choice for the database developer. SQL Server Management Studio still has its place as a light free tool, but for serious database development with Team Foundation Integration, Visual Studio is the tool of choice.
Using Local Databases
Visual Studio creates local databases when a database project is created, viz.
- MSSQLLocalDb — SQL 2014 local db
- ProjectsV12 — created by SQL Server Data Tools (SSDT)
- V11.0 — SQL 2013 local db
These local database instances are located on a file location on the local drive of the computer that runs Visual Studio at: C:\Users\hendriekusr\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances.
The server name consequently is: (localdb)\ProjectV12. Details about these installed databases can be obtained by running the SQlLocalBD.exe (located in C:\Program Files\Microsoft SQL Server\110\Tools\Binn\) against the name of the database, e.g. info ProjectsV12.
Use the Instance pipe name (from above execution) to connect to a local database from SQL Server Management Studio (SSMS), as depicted below.
A connection (to view database objects) is possible from VS and SSMS with the latter using the pipe connection string. The SSMS screen (below) illustrates how the connection is made to the localDB as well as a Stored Procedure created from a SSMS template that was added to the database. The next article [Create a Stored Procedure Item Template] illustrates how this same SSMS Stored Procedure template is created for Visual Studio.