Questions tagged [database-project]

Visual Studio Database Projects allow developers to create, manage, update, and deploy databases with the same development tools and processes as any other source code project.

A Visual Studio Database Project is a standard project Visual Studio project type that gives database developers the same level of integration with the development process as other source code project type. Different versions of Visual Studio has included different levels of support for database projects and database development.

Visual Studio 2005 introduced a project type called a "database project", which was primarily a collection of SQL scripts. There was no build or deployment support for this project. It did have source control integration and permitted execution of scripts directly against a referenced connection. This type of project is considered obsolete, and is no longer provided with Visual Studio.

Visual Studio 2008 Database Edition GDR introduced a new project, also called a "database project", to replace the previous project type. This new project type, a dbproj, behaved more like a source code project, in that it supported refactoring, code analysis, and had explicit build and deployment support within Visual Studio. Visual Studio 2010 included this project as its sole form of database project.

Visual Studio 11 includes a newer form of the database project, called a SQL Server Data Tools or SSDT project. (SSDT projects are also available as an add-on to Visual Studio 2010). These sqlproj projects are similar to VS2010 database projects, but provide better integration into the Visual Studio IDE, support SQL Azure deployment, and provide a new connected Object Explorer experience within Visual Studio.

This tag is appropriate for questions on any of these database project types, or the Visual Studio tools that are used to manage them (such as vsdbcmd).

631 questions
14
votes
5 answers

Visual Studio Database project: checking if SQL server login exists before creating it

When I create a Visual Studio database project for SQL 2012 and synchronise it with an existing database (using Compare Schema), I also synchronise a SQL server login. Visual Studio generates the following script for the login: CREATE LOGIN…
JustAMartin
  • 13,165
  • 18
  • 99
  • 183
13
votes
3 answers

Visual Studio Database Project and SQL Azure

I'm really struggling with the best approach for managing a SQL Azure database which is based on a Visual Studio 2010 Database Project. I figured it would be easy enough to use VSDBCMD to create diff scripts for upgrades and then simply run against…
13
votes
1 answer

How to avoid circular references with visual studio 2012 Database project

I am trying to create a database solution in Visual Studio 2012. I have 5 databases that all exist on the same server, so I have imported each of them into a database project. Unfortunately there are quite a few objects in the databases that…
jazza1000
  • 4,099
  • 3
  • 44
  • 65
13
votes
4 answers

How do I convert a Visual Studio 2010 database project to an SSDT Project

I have a clean install of windows 7 with Visual Studio 2010 Premium inc. SP 1. I also just installed the developer edition of SQL Server 2012 . I now should be able to convert the Visual Studio 2010 database project to an SSDT project. According to…
12
votes
2 answers

Database deploy (vsdbcmd.exe): DatabaseName and DefaultDataPath are ignored?

Visual Studio database edition comes with a tool, vsdbcmd.exe, that should allow someone to deploy a .dbschema file (which is generated by the database project on build) to a database. It does this by first building the script, then executing…
Kurt Schelfthout
  • 8,880
  • 1
  • 30
  • 48
12
votes
3 answers

Why does my DB project's .dbmdl file change even when I make no changes to the project?

I'm running into a small but weird annoyance that seems to be happening to other people, too (for example, check out the revision history of SEDE). I have a SQL Server 2008 database project in Visual Studio 2010 that works properly. When I go to…
12
votes
2 answers

SQL Server project executing multiple script post deploy

I have a SQL Server 2008 DB Project, and want to execute multiple scripts, in order, on post deploy. I've added a PostDeploy.Sql script to a scripts folder, and marked that as PostDeploy, and that works fine. I'm aware that only one script can be…
Paul Michaels
  • 16,185
  • 43
  • 146
  • 269
12
votes
2 answers

How to publish DACPAC file to a SQL Server database project via SQLPackage.exe of SSDT?

I'm using SSDT for Visual Studio 2012 here and using its command-line tool SQLPackage.exe to publish a .dacpac file. I want to publish that to an SQL Server database project. I'm trying to use parameter at this guide but cannot find ways how to do…
Nam G VU
  • 33,193
  • 69
  • 233
  • 372
12
votes
6 answers

Database schema compare options in Visual Studio 2013 - where to set global options?

I'm just in the middle of migrating my solutions from Visual Studio 2010 to Visual Studio 2013. I have this (maybe) silly problem with database comparisons options. I would like to exclude certain object types from comparison globally so that I…
Szymon
  • 42,577
  • 16
  • 96
  • 114
12
votes
3 answers

In SSDT Schema Compare how do I ignore differences in objects of type "Schema"

From the Schema Compare Options, I deselected all Object Types: It still shows me differences in Schema objects: I scrolled through the big list of General options, and none of them appeared to do this:
12
votes
1 answer

SQLCMD variables and SSDT schema compare issue

I want the comparison below to not show a difference. According to MSDN (see step 7), there should be a SQLCMD Variables function available which I cannot find. This documentation is for SQL 2010, but I am using 2012. There doesn't appear to be 2012…
12
votes
2 answers

Deploy VS 2010 database project using MSBuild and TeamCity

Is it possible to deploy a VS 2010 database project using TeamCity? I am building my whole solution, and deploying a website to my server, this all works fine. The final step I want to trigger is the deploy of the database project which generates a…
ozz
  • 5,098
  • 1
  • 50
  • 73
11
votes
1 answer
11
votes
2 answers

Visual Studio 2010 Database Projects: Are there any videos/tutorials or comments about the new Database Project Types?

I have recently upgraded to Visual Studio 2010. I have kept database projects separate to application projects. The database project was converted from and old DPR project and added a whole lot of additional folder. I deleted those, but now I…
Mark Redman
  • 24,079
  • 20
  • 92
  • 147
11
votes
1 answer

Using variable in sql postdeployment build script?

What I would like to be able to do, is to be able to create a publising xml script in Visual Studio database project that defines a variable, that will be used to compose a script. My problem is that I get a Error: "SQL72008: Variable DeployType is…
Sturla
  • 3,446
  • 3
  • 39
  • 56
1 2
3
42 43