Saturday, December 5, 2009

Best Practice with using comma in SQL Server statement

First of all it's a good idea to break your SQL statement into multi lines for readability so let's see this example:

Note that the comma has placed at the beginning of next line so when you do this you have more easily way to comments your line without any effort and then you can return it again after your test as following:


And also this way will help you to easily find the errors caused by missing comma or adding extra comma.



No comments: