Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do NOT deploy a SQL Server Database project when debugging?

I'm using Visual Studio 11 Beta with a SQL Server Database project and a console app project. Every time I hit F5 to debug my console app, it wants to deploy the database project. Is there any way to keep it from doing that? I can't find any settings to prevent it.

like image 294
Brian Sullivan Avatar asked Mar 26 '12 03:03

Brian Sullivan


People also ask

What does it mean to deploy a database?

Deployment could indicate one of several different activities: Shipping a new database that is closely integrated with a single application. Releasing into 'production' a new version of a database, over the top of the old one, in synch with a revised version of a close-coupled application.

How do I deploy a SQL database project?

In the SQL Database projects extension, click on Install for developing and deploying database schemas. This project extension is helpful for the following tasks. Open a Project deployed in SQL Server Data Tools or Azure Data Studio. You can add or remove objects (tables, views, stored procedures) in the project.

What are the database objects we can debug in SQL Server?

Managed database object debugging in Visual Studio supports all common debugging features, such as "step into" and "step over" statements within routines executing on the server. Debuggers can set breakpoints, inspect the call stack, inspect variables, and modify variable values while debugging.


2 Answers

The problem here is that when you say I want to build and deploy (hitting F5 does this in order to debug) you don't actually want the DB to be part of that deployment.

I'm afraid I don't have VS 11 Beta, but this is achieved by disabling the Deploy of the project in the Build Configuration.

Below is a screenshot from VS 2010, hopefully you can find an equivalent (sorry, I couldn't find the MS documentation for 2012).

Find the project you don't want to deploy, and uncheck the relevant check box under the Deploy column.

Where to find the Build Configuration drop down

Select Configuration Manager from the drop down

Uncheck Deploy for the relevant project

like image 182
hanzworld Avatar answered Sep 22 '22 05:09

hanzworld


Double-click on the Properties node of the Database project in Solution Explorer to open the Database project properties. Select the Deploy tab. In the Deploy action section, select "Create a deployment script (.sql)" instead of "Create a deployment script (.sql) and deploy to the database".

like image 40
David Brabant Avatar answered Sep 22 '22 05:09

David Brabant