andyb952
andyb952

Reputation: 2008

Dry-run DACPAC with sqlpackage

Is it possible to execute a "dry-run" using sqlpackage.exe on a DACPAC?

The reason I am asking is that we have an internal process with automates and tracks all changes to the database but also an external process that does manual releases.

What I want to do is to verify that deploying said DACPAC will not overwrite any changes made by the external process which we have no control over.

Upvotes: 4

Views: 1253

Answers (2)

SAS
SAS

Reputation: 4035

If you want to write more custom controls to check which objects will affected, use one of the action-parameters: script, or deployreport.

Also, there is a drift-checking mechanism, with parameter options driftreport/ BlockWhenDriftDetected. They will display/block deploy when schema drift, from last deploy, is detected. Then you can check the drift and decide what to do.

SqlPackage.exe: https://learn.microsoft.com/en-us/sql/tools/sqlpackage?view=sql-server-2017#driftreport-parameters

Register a Database As a DAC: https://learn.microsoft.com/en-us/sql/relational-databases/data-tier-applications/register-a-database-as-a-dac?view=sql-server-2017

Upvotes: 0

Steve Ford
Steve Ford

Reputation: 7753

You can use the SQLPackage option DeployReport to generate a report of changes that would be performed:

SqlPackage.exe /action:DeployReport <code> ....

Upvotes: 5

Related Questions