Is it possible to test a DACPAC against the DB without deploying it? sqlpackage.exe with Action=Deploy will deploy it if no errors are found and Action=Report will just generate a report with the list of changes but deployment can still fail.
Is it possible to test a DACPAC against the DB without deploying it? sqlpackage.exe with Action=Deploy will deploy it if no errors are found and Action=Report will just generate a report with the list of changes but deployment can still fail.
Documentation says:
The SqlPackage.exe publish operation incrementally updates the schema of a target database to match the structure of a source database.
So, the success of the operation depends on current state of database to be updated. For example, the DAC package defines following table:
table MyTable (
X int not null
);
while current definition of the table is
table MyTable (
X int null
);
If the column X doesn't contain nulls the deployment will be succeed, and it will fail otherwise. So, there are several ways to check the deployment before publishing to production.
Script action to create a script that updates the schema of a target to match the schema of a source. Afterwards you could analyze the script to find out possible fails during real deployment.