http://www.sqlservercentral.com/blogs/kendalvandyke/2011/04/06/posting-code_3F00_-trust_2C00_-but-verify/

Printed 2014/07/29 08:58PM

Posting Code? Trust, But Verify

By Kendal Van Dyke, 2011/04/06

Here's a tip for bloggers (or anyone else) who use third party tools to convert T-SQL code into a publishing  friendly format…

Yesterday I posted scripts to identify overlapping statistics and I used a tool to convert the T-SQL into something that retained the formatting you'd see in Management Studio. This morning I received an email from a keen-eyed reader who brought a misspelling to my attention. Of course I had checked my code before I used the tool but not after, and sure enough it had added an extra letter into one table alias in the script. Here's what it looked like before and after formatting was applied:

Trust But Verify

So today's lesson: Trust, but verify. Even if you check that your code works before you apply formatting make sure to copy it back to Management Studio afterwards and see that it still runs like you think it's supposed to.

(And for what it's worth I've fixed the error in the original blog post. If you copied the scripts yesterday you may want to revisit the post and copy them again)


Copyright © 2002-2014 Simple Talk Publishing. All Rights Reserved. Privacy Policy. Terms of Use. Report Abuse.