Please use the SqlPackage parameter named DropObjectsNotInSource. Please read documentation here. It is a boolean parameter.
You may want to consider also having BlockOnPossibleDataLoss parameter disabled.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello,
I have 26 tables in my Development database. Using the SQLPackage "Extract" action I am able to generate the DACPAC file and using the "Publish" action deployed in UAT database. All 26 tables deployed successfully in UAT.
Later I deleted 2 tables from Development database and then followed the same steps of extract and publish, but both the tables did not get deleted from UAT database.
I read the Publish action by default will not drop the tables from the target database if not exist is source database. Can anyone guide me how we can achieve this?
Thanks,
Sachin
Please use the SqlPackage parameter named DropObjectsNotInSource. Please read documentation here. It is a boolean parameter.
You may want to consider also having BlockOnPossibleDataLoss parameter disabled.
Hi @sachin gupta
You could specify property DropObjectsNotInSource=(BOOLEAN)
to the Publish action.
Specifies whether objects that do not exist in the database snapshot (.dacpac) file will be dropped from the target database when you publish to a database.
You can find more information about this utility and SQLPackage actions from the official documentation from Microsoft.
Best regards,
LiHong