Skip to content

SQLDeploy

Robb Schiefer edited this page Aug 31, 2016 · 8 revisions

SQLDeploy 2.3+

As of SQLDeploy package version 2.3, the Nuget package defaults to using DacPacs for SQL Server database deployments. Prior versions didn't specify any deployment by default which required more setup by the user to configure what to deploy and how. We believe this change will make SQLDeploy as easy as possible to get started with. That being said, all older SQL deployment options still exist in the package if you need them.

Basic Setup

  1. Add a new Class Library project to your solution which will act as your SQL deployment project

  2. Add the MSDeployAllTheThings.SqlDeploy Nuget package to your SQL deployment project

  3. Open the [ProjectName].spp.targets file and update the DatabaseProject node to the name of the SQLServer database project in your solution.

  4. Build the project with the /p:DeployOnBuild=true flag and the MSDeploy package will be created in the bin/[configuration]/sqlDeployment folder.

Class Library Project

This seems odd to use a Class Library Project to deploy a SQL database. We would prefer to use the Database Project itself but the problem is Nuget doesn't allow you to add a package to a Database project. Not sure why. So, you need another project, it doesn't matter what kind, that will kickoff MSBuild and support Nuget packages.

Clone this wiki locally