Home Dashboard Directory Help
Search

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


Status: 

Closed
 as By Design Help for as By Design


6
0
Sign in
to vote
Type: Bug
ID: 774098
Opened: 12/12/2012 2:02:47 AM
Access Restriction: Public
1
Workaround(s)
view
0
User(s) can reproduce this bug

Description

Hi,

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
as
/*
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,


Details
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.

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

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.

Tony.
Sign in to post a workaround.
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. To ignore such differences, enable the "Ignore Comments" option.