HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlModerate

sqlpackage.exe ignoring BlockOnPossibleDataLoss?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
ignoringexesqlpackageblockonpossibledataloss

Problem

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.

Solution

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.

Context

StackExchange Database Administrators Q#53033, answer score: 11

Revisions (0)

No revisions yet.