While writing my last post on cleaning up old maintenance plans, I was reminded of something I heard in a presentation once (and unfortunately I can't remember who said it) that has stuck with me for the last several years:
Why is this? If you use double-dash inline comments:
SELECT COL01, COL02, from dbo.mytable
...and your code gets opened in Notepad/Wordpad or some other editor that utilizes Word Wrap, it could look like this:
SELECT COL01, COL02, from dbo.mytable
Good luck executing that code after it has been copy-pasted in this format into a query tool....something like "Improper syntax near 'posed'"
Even if you don't try to execute it, it can be difficult to read and troubleshoot when similar pieces of code are near each other and one line or the other is double-dash commented out.
So the hint to this is always, always, ALWAYS use star-slash comments /* */ even if your comment is short (even a single word) - it's not a bad habit to get into and doesn't cost you much (two extra characters) to protect you from this problem.
SELECT COL01, COL02, from dbo.mytable
Hope this helps!