Differences between SqlPackage.exe and MsBuild SqlPublishTask

I am trying to create a dacpac output file which can then be deployed in different environments. So far, I have deployed directly from msbuild using the target publication, for example:

msbuild dbproject.sqlproj /t:Build;Publish /p:SqlPublishProfilePath=test.publish.xml  /p:UpdateDatabase=True  /p:PublishScriptFileName=test.sql

The size of the generated ouput script (for reference only, since UpdateDatabase is true) is 2.5 MB.

My new approach is to simply create a project, save dacpac, and then deploy using sqlpackage with the Publish action. This new method reports some warnings that were not reported in msbuild SqlPublishTask.
For reference, I ran the following command:

sqlpackage.exe /action:script /outputpath:test.sql /sourcefile:dbproject.dacpac /pr:test.publish.xml

and the script output size is now 4.9MB.
The specific warnings in question are not a concern, the concern is that the script is different, my question is what is the difference?
and more importantly, which one would be the best / safe way to deploy?

+4
source share
1 answer

Sqlpackage.exe , , - , .
, script sqlpackage , .

, , sqlpackage, , , . "" sp , , , sp.

+1

Source: https://habr.com/ru/post/1599048/


All Articles