[SSDT] Whitespace in a comment is not ignored when using the ignorewhitespace option - by Dave_Ballantyne

Status : 

  By Design<br /><br />
		The product team believes this item works according to its intended design.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 774098 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 12/12/2012 2:02:47 AM
Access Restriction Public



i have been comparing schema 'A' to schema 'B' and have been having some random procs being returned as being changed.  We can see that there are only whitespace changes and that the ignore white space option is set.

Turning on the ignore comments option caused the changes to be ignored.

So consider a proc in a schema:

Create Procedure dbo.myproc
My Comment
Select * from myTable;

if that exists on a database during schema compare all well and good.
Add spaces to the SELECT statement , still no change will be seen.

However insert a few TABs between "My Comment" and a spurious change will be seen,

Sign in to post a comment.
Posted by Dave_Ballantyne on 12/17/2012 at 11:16 PM
Hi Tony,

That being the case, which i dont fully buy, then the schema comparison tool inside SSDT itself needs an enhancement to highlight the same change. In the real world this caused a delay to a release and mutterings of trust issues with the process ( SSDT building automated deployment scripts). It took me having to use a hex editor to find out what the change exactly was.

Posted by Tony Gedge on 12/17/2012 at 12:06 PM

The "Ignore Whitespace" option does not apply to comments in TSQL. Differences in whitespace within comments are always considered significant. As you have found, the only way to ignore such differences is to enable the "Ignore Comments" option.