Visual Studio 2012 SQL Database Project with SSDT
Asked Answered
A

2

5

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?

Annulus answered 11/9, 2012 at 18:31 Comment(0)
F
12

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.

Friedafriedberg answered 11/9, 2012 at 18:43 Comment(2)
Ok so if I got this right, SQL Server Object Explorer is for online development meanwhile working on the other side in Solution Explorer is for offline development that can then be committed to the online database by doing a schema compare and update. Makes sense! Thanks.Annulus
You won't need to run Schema Compare. The F5 (Debug) option will push the changes from the Database Project (in the Solution Explorer) to the database described in (3)Schorl
I
3

There are many differences between SQL Server Object Explorer (SSOX) and Server Explorer. Here's a couple: SSOX allows you to launch refactoring operations SSOX provides a logical view of your source code in Solution Explorer

In short, SSOX targets database development whereas Server Explorer is (I think) a generic hierarchical viewer for many server types.

Regards Jamiet

Imputation answered 16/9, 2012 at 22:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.