I have a dacpac that has set the BlockOnPossibleDataLoss set to false, however the deployment is blocked when I run it with sqlpackage.exe, telling me "The column [a] is being dropped, data loss could occur."

However when I use the exact same deployment profile and publish from Visual Studio 2012 it goes through.


Have you tried executing sqlpackage.exe with /p:BlockOnPossibleDataLoss=false in the command line?

I just used SQLPackage.exe to create a .dacpac file of my test database, then I pubished it with the /p:BlockOnPossibleDataLoss=false option, and it overwrote my database.


I had the same issue and /p:BlockOnPossibleDataLoss=false don't work.

The final solution was in my case, that it also has to be set in the debug settings of the project file:

Project debug settings

Hope this helps someone! :)

  • 1
    and if you "publish" directly, you'll have to set up this option in the "advanced" publish option as well!
    – Pac0
    Jul 16 '19 at 8:39
  • In my case this solved partially the issue. Deployment failed however, because a constraint was depending on the object I want to modify. Apr 22 '21 at 12:32

Finally found the issue, I execute sqlpackage.exe within a powershell script where the error handling is set like

$Script:ErrorActionPreference = "Inquire"

since i never got the Inquire I assumed the problem was with sqlpackage.exe, however I had another powershell script included after the ErrorActionPreference was set, turned out the included script also had the ErrorActionPreference set, but to "Stop". Still I believe if I have set BlockOnPossibleDataLoss=false it should not result in an error, but at least I now have a way to handle it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.