Blog Post

Why Format TSQL?

,

Recently I had the chance to help a student debug a problem on a production server. It appeared to be failing because duplicate uniqueidentifiers were being created. Thinking that unlikely because the G in GUID stands for global, we dug in but found the code painfully hard to follow due to poor formatting, mainly the indents. She didn't own one of those 'prettifier' tools, so we used my old standby Instant SQL Formatter, an online formatter that does a reasonable job of formatting TSQL at a great price - free! Note: I have no ownership or other interest in the site. Many scoff at making code pretty, but especially with a tool to do it for you it can really make life easier for the next person.

And the answer to the problem? The GUIDS were fine, there was a fall through case that had an incorrect error message, and that in turn was being caused by a data problem.

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating