Publishing SSDT script recreates procedures without changes

I have a database imported into a profile .sqlprojand .publish.xmlthat posts the changes to a remote database.

I understand that when I right-click → Publish → Generate Script, it must calculate the difference between local definitions and the remote database and generate a script to cast the remote DB to a string.

It all works fine, but the script, which he generates, always contains the instructions ALTER FUNCTIONand ALTER PROCEDUREfor the same 40 or so functions and procedures (of in total about 1,000 defined), whether changed or not. When I compare statements ALTERwith script Function as → ALTER to script in SSMS, they are exactly the same.

So my question is: why does VS think they are different, or why do they recreate them anyway if they are the same?

Notes:

  • Functions are not special - some of them are as simple as defining a varchar, setting it to a value, and returning it.
  • I tried to run the scripts ALTERin the database, but they continue to be created.
  • I checked the properties (right click → properties) in SSMS, but I see nothing obvious in the fact that it always recreates, and those that it does not.
  • My public profile is a standard swamp.

thank

0
source share
1 answer

Update:

.dacpac .zip model.xml, , <HeaderContents> &#xA; (LF - ).

, - .SQL UNIX (LF) Windows (CR LF). ( notepad ++) .

:

, , , . , . .

SET @doesnt_work = 
'FOO
BAR'

SET @works = 'FOO'  + CHAR(13) + CHAR(10) + 'BAR'

. , , , , - ...

0

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


All Articles