How to Publish Visual Studio Database Project in VS 2015
Asked Answered
D

1

14

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.

Dodson answered 2/2, 2016 at 23:18 Comment(0)
Q
20

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.

Quoits answered 3/2, 2016 at 15:17 Comment(1)
Nice answer. I can't believe I didn't see Publish in the project context menu, lolDodson

© 2022 - 2024 — McMap. All rights reserved.