Blog

March 18, 2015
|

DACPAC Deployment with Variables

Did you ever try to deploy the compiled DACPAC file of a Data-Tier Application Project using SQL Server Management Studio with┬áthe built-in wizard (Tasks > Upgrade Data-Tier Application)? Hopefully you’ll answer this with yes. It’s easy and quick – some clicks and you’re done.

But if you try to do the same with a DACPAC containing SQLCMD Variables you’ll not be successful – never ever. If you try this using the same wizard, you’ll get this error:

DacpacDeploymentErrorSqlcmd

If you want do deploy you DACPAC, you need to do it using a command line tool called SqlPackage.exe (MSDN). You could also use an XML-configuration (Profile / DeploymentProfile.xml) to parameterize the deployment. Here’s an example:

Finally you need to call SqlPackage.exe to start the deployment:

  • Generate a Drift Report (To be reviewed before execution)
  • Generate a XML Deployment Report (To be reviewed before execution)
  • Generate the Change Script that will be executed (To be reviewed before execution)
  • Execute the Deployment


0 Comments


Would you like to share your thoughts?

Would you like to share your thoughts?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.