问题
I am running SqlPackage in my CI build to deploy dacpacs and pass in a publish.xml file using the /Profile switch. I have the following three options set in the profile:
<DropObjectsNotInSource>True</DropObjectsNotInSource>
<DoNotDropPermissions>True</DoNotDropPermissions>
<DoNotDropUsers>True</DoNotDropUsers>
However when I run the dacpac deploy it still tries to drop my users. Any ideas?
回答1:
There is (unfortunately) a bug in SqlPackage.exe's handling of publish profiles, whereby the DoNotDrop and Exclude options are not honored. This will be fixed in an upcoming version of SqlPackage.exe. In the meantime have you tried using this SqlPackage.exe command line argument?
/p:DoNotDropObjectTypes=Permissions;Users
回答2:
Check the timestamp and version on your SqlPackage.exe. You may be calling the wrong one.
The one that will honor the DoNotDrop and Exclude options should be stamped 7/30/2015 3:04AM, versioned 12.0.3021.1 and be located here: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\120
The other one (which does not honor these settings) is stamped 3/28/2014 10:56pm, versioned 12.0.1294.0 and is at C:\Program Files (x86)\Microsoft SQL Server\120\DAC\bin
来源:https://stackoverflow.com/questions/35346757/sql-dacpac-deploy-using-sqlpackage-and-dropobjectsnotinsource-with-donotdropuser