As an example, I have this script:
After I execute it on the database and run a comparison, its showing a false positive difference:

Any ideas on why this is happening?
Comments
6 comments
-
Hi - what are you comparing to get that diff? Scripts folder to database?
-
@heck4
Following @Mark R 's investigation, we've reproduced the issue and logged as it as SC-10390 in our internal bug tracking system. Thanks for reporting it! Please keep an eye on the release note.
-
Yes you are correct Mark. Scripts folder to database. We treat our source control as the system of record.
-
A few other things that may help:
- SQL Compare 10 does not exhibit this bug, and treats the two different syntaxes as interchangeable.
- I've read that CAST is implemented internally within SQL as an alias to CONVERT.
- Using SSMS 17.7, when I use the above script to create the table, and then re-script it out using SSMS it uses CONVERT, getting rid of my original CAST syntax.
Thanks. Feel free to close this ticket.
-
Thanks! I've put a note in the bug report.
-
@heck4
The dev team has looked into this issue. To be fair, it's not an error in SQL Compare. The differences are real, and we're reporting them as such. As you said, it turns out that SQL Server is basically rewriting the CAST operation to a CONVERT operation under the covers.
You should be able to workaround it by using SQL Server's preferred CONVERT syntax instead of CAST.
Add comment
Please sign in to leave a comment.