Monday, June 22, 2009

SSMS 2008 Uncomment Bug

In SQL Server Management Studio 2008, there is a bug in the way it uncomments lines of code.

If you start with this code:
--Code line 1
--Code line 2
--Code line 3
--Code line 4

Code line 5
and want to uncomment lines 1, 2, and 3, you would select the first three lines and click [ctl]K/U.

The problem is that in SSMS 2008, if the line immediately after the line or block you are trying to uncomment is also commented, that line will be uncommented.

I know that's hard to follow, but after selecting lines 1, 2, and 3 to uncomment, you will end up with lines 1, 2, 3, and 4 uncommented.

Instead of this:
Code line 1
Code line 2
Code line 3
--Code line 4
Code line 5
You'll see this:
Code line 1
Code line 2
Code line 3
Code line 4 -- whoops
Code line 5
I entered this issue at Microsoft Connect in February. They logged it as bug ID 418596.

Today, they replied and wrote that they would fix it (someday). This is great news.
Hello rgarrison,

Thank you for reporting this problem. We understand the usability issue wrt uncommenting and will fix this issue in a future release.

Thanks,
-Karthik

No comments:

Post a Comment