Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Publish Visual Studio Database Project in VS 2015

I was unable to google this.

We have an existing database project (sql server).

Some new files (scripts) were added.

We have an existing server / database where some new scripts need to be run into that context.

In Visual Studio 2015, how can I accomplish this?

I was told to stay inside Visual Studio 2015. Ideally, I'd like to issue one command vs one for each individual script.

like image 849
toddmo Avatar asked Feb 02 '16 23:02

toddmo


People also ask

How do I publish a Visual Studio 2015 profile?

Create a publish profile in Visual Studio by choosing one of the following paths: Right-click the project in Solution Explorer and select Publish. Select Publish {PROJECT NAME} from the Build menu.


1 Answers

You have a couple of choices.

  1. The Publish option. This is a totally automated deployment of what's in the db project to the target server. Do this by right-clicking your project and selecting Publish. This option can be used to perform an incremental deployment (only the changes are deployed) or can be used to wipe a database clean followed by a full deployment of the db project, so check all options before performing publishing.
  2. Schema Comparisons. Schema comparisons perform a comparison of the db project to the target database, shows you the differences, and lets you select which differences to deploy. You can perform a schema comparison by adding a new Schema Compare file to your database project.

In short, the publish option allows automated brute force deployments, whereas schema comparisons provide more flexibility by letting you choose which changes to deploy, but schema comparisons cannot be automated.

like image 84
Keith Avatar answered Oct 20 '22 08:10

Keith