Search code examples
visual-studio-2012sql-server-2012sql-server-data-tools

Visual Studio 2012 SQL Database Project with SSDT


I'm starting to use Visual Studio 2012 with integrated SQL Server Data Tools and although I watched 2 of microsoft's video's on getting started with SQL Database Projects I'm still having trouble understanding how to work with them especially since I'm new to db development.

Some questions:

  1. What is the difference between Importing a database or adding a reference to the database?

  2. What is the difference between Server Explorer and SQL Server Object Explorer tabs? In one I can browse the database through localhost\SQLEXPRESS.dbname and the other goes through localdb\Projects. At what point are these synchronized?

  3. How do I change the Target Database Name under the Project's properties?


Solution

  • 1) Importing a data base creates a project that includes all of the databases artifacts. Adding a database as a reference allows a project to access the database. So if you have a SSDT project and a c# project that uses the db, the c# project gets the reference. You could choose to create the SSDT project by importing an existing db.

    2) SQL Server Object Explorer is part of SSDT and allows you do perform online SQL development including creating new artifacts, adding data to tables, and executing scripts.

    3) To change the target database name for debugging purposed (where the database goes when you build/debug) change the target connection string in the debug tab of the properties menu of the project.

    I've found this link to be quite helpful.