I recently attended Quest’s Virtual Conference on Performance and Wait Events back on July 21. Which by the way is on demand until August 23, 2010 so get over there and start a watching while you can. Honestly I did not get to watch everything live so I have some things to go back and watch as well.
The event was awesome of what I got to watch. This is the second time Quest has done this and I attended the last one they had as well. This time around it involved Kevin Kline (blog
| twitter), Brent Ozar (blog
| twitter), and Buck Woody (blog
| twitter). Within that first session the subject came up on commenting within your T-SQL code. Buck made some statements toward how people shouldn’t be using single-line commenting
("--") and instead be using multiple-line commenting
("/*" and "*/") in their code. The main purpose was for readability. My take on it is you should just do everything Buck Woody tells you to do, cause he’s just awesome.
I like this idea and tend to use the multiple-line comment tags more often than I do the single line tags. I do believe the multiple-line tags make your comment stand out more in the code. Some comments from twitter on the matter, brought up that there are shortcut keys and such in SSMS (SQL Server Management Studio) that allows you to comment out a selection of code. However the method used does not follow Buck’s wishes (advice) and uses just the
"--" (single comment) tag to comment out the code I select, whether I highlighted 1 line or 100 lines of code.
So I used the power that Microsoft gives its users and went over to Microsoft Connect for SQL Server and searched for this feature. I could not find an active suggestion for this addition of a “block comment” menu item or shortcut. So, I submitted one of my own: SSMS Block Commenting or multiple-line commenting.
So if you feel as strongly as I do about this please go over to the page and vote it up. Maybe someday Microsoft will add it in.