Format your T-SQL code

Good T-SQL code formatting really does matter. There are things that will help you and others read the code more quickly. It also helps to avoid mistakes that can take hours to find and fix.

Microsoft is requiring the semi-colon in more and more statements. You’re going to hit issues if you don’t use it as a statement-terminator in all your statements. Yes, older code can still work, but as you add newer functions, you’re going to hit the issue. Eventually they’re going to require the terminator for all statements, just start writing it that way now and avoid the issue.

SQL Prompt includes tools to help with this.

This article makes some very good points. Please read this. It will be well worth your time.

https://www.simple-talk.com/sql/t-sql-programming/devil-wrote-code/

Leave a Reply

Your email address will not be published. Required fields are marked *