Ramblings of a DBA

Tara Kizer
posts - 165, comments - 832, trackbacks - 75

My Links

Advertisement

News

Subscribe
Search this Blog

Archives

Post Categories

Work

Commenting Blocks of Code in SQL Server 2005

In Query Analyzer, we could easily comment blocks of code using Ctrl+Shift+C and uncomment blocks of code using Ctrl+Shift+R.

These keyboard shortcuts do not work in Management Studio unless you switch the keyboard scheme to SQL Server 2000.

In Management Studio, you can comment blocks of code using Ctrl+K, Ctrl+C and uncomment blocks of code using Ctrl+K, Ctrl+U.  These are the same keyboard shortcuts that you would use to comment blocks of code in Visual Studio .NET, so I'm sure that's why Microsoft decided to switch the shortcuts. 

To see other keyboard shortcuts for T-SQL code in Management Studio, open a query window by clicking the New Query button.  Click on the Edit menu then Advanced.  You must be in a query window for the Advanced item to appear in the Edit menu. 

Print | posted on Wednesday, September 13, 2006 4:57 PM | Filed Under [ SQL Server - General ]

Feedback

Gravatar

# re: Commenting Blocks of Code in SQL Server 2005

Hey Tara
when i try and comment code using ctrl+c in management studio it doesn't work, wierd. so i changed the option under tools, options, environment, keyboard, there changed the keyboard scheme to SQL 2000. now i have the old favourite shift+ctrl+c for comments and shift+ctrl+r for uncomment.
9/14/2006 1:59 AM | leigh
Gravatar

# re: Commenting Blocks of Code in SQL Server 2005

You can still use the 2k way by changing the default keyboard schema in MS
9/14/2006 8:36 AM | Jon
Gravatar

# re: Commenting Blocks of Code in SQL Server 2005

Opps first poster already said that..should of read :).
9/14/2006 8:37 AM | Jon
Gravatar

# re: Commenting Blocks of Code in SQL Server 2005

Leigh,

You have to hit Ctrl+K, Ctrl+C. It requires both. Ctrl+C is of course copy.

Yes I am aware that you can change it to the 2000 keyboard. But I hate to stay back in the times, so I've adopted the new keyboard layout.
9/14/2006 9:35 AM | Tara
Gravatar

# re: Commenting Blocks of Code in SQL Server 2005

aah that's better, thanks Tara
9/14/2006 11:28 PM | Leigh
Gravatar

# re: Commenting Blocks of Code in SQL Server 2005

What's wrong with /* ... */ ? Is it just a coding speed thing?

-D.
11/8/2006 10:07 AM | David
Comments have been closed on this topic.

Powered by:
Powered By Subtext Powered By ASP.NET