Click here to monitor SSC
  • Av rating:
  • Total votes: 53
  • Total comments: 18
Andrew Clarke

SSMS: The Query Window Keyboard Shortcuts

10 June 2011

Simple-Talk's free wallchart of the most important SSMS keyboard shortcuts aims to help find all those curiously forgettable key combinations within SQL Server Management Studio that unlock the hidden magic that is available for editing and executing queries. 

The Keyboard shortcuts that are displayed in the wall-chart are based on what is on Books-on-line, but reordered and grouped in such a way as to make it easier to find what you're looking for. We've also taken out a lot of the keystrokes for navigating rapidly between various parts of SSMS that aren't related to the query windows, since this was intended more for the SQL developer. We added the SQL Prompt keys since SQL Prompt is so widely used.

The Wallchart is available from the speech-bubble at the head of the article as a PDF, but is also available as an HTML file, by clicking on the large thumbnail below. Of course, if you have eyes of cyborg-style pixel-density, you may get by just by reading the thumbnail below.

There was recently an amusing debate on ASK.SQLServerCentral.com as to which was the most important Keyboard shortcut. 'Save current window' one was voted highest. It is so much easier to do that than to use the GUI menus, so it is more likely to get done as a routine. However, you'll find many gems in this Wallchart.

Andrew Clarke

Author profile:

Andrew Clarke has been developing software applications for over 35 years. He is a database expert, but also has had many years of experience in designing and programming applications and software tools. He has a particular interest in website-publishing and ECommerce. Before joining Redgate, he worked with the first two winners of the 'Apprentice' program at Amstrad, creating various business applications, He is the editor of Simple-Talk.

Search for other articles by Andrew Clarke

Rate this article:   Avg rating: from a total of 53 votes.


Poor

OK

Good

Great

Must read
Have Your Say
Do you have an opinion on this article? Then add your comment below:
You must be logged in to post to this forum

Click here to log in.


Subject: Thanks!
Posted by: Khalid F (not signed in)
Posted on: Sunday, June 12, 2011 at 10:20 AM
Message: Thanks for going to the effort to create this. Much appreciated! Gotta love the shortcuts...

Subject: Block Comment
Posted by: DrFooMod2 (not signed in)
Posted on: Monday, June 13, 2011 at 7:21 AM
Message: You forgot Ctrl+K, Ctrl+D for comment line (or block) and Ctrl+K, Ctrl+U to uncomment.

Subject: Current Query - Excecute
Posted by: JustMe (not signed in)
Posted on: Monday, June 13, 2011 at 10:00 AM
Message: Alt-X will also Execute the Current Query. Easy to remember X = Execute.

Subject: Block Comment and Current Query Execute
Posted by: Andrew Clarke (view profile)
Posted on: Monday, June 13, 2011 at 11:30 AM
Message: Block Comment
 That would be handy. I'll add that in if I can get it to work, but it gives an error in my SSMS with the message 'The key combination (Ctrl+K, Ctrl+D) is bound to command (Form&at Document) which is not currently available.'
Alt-X
Alt-E Easy to remember E = Execute. I seem to remember reading that Alt-X was flagged for deprecation, which was why I didn't include it. Anyone know for certain?

Subject: Can the format be changed?
Posted by: Steve Durette (not signed in)
Posted on: Monday, June 20, 2011 at 1:28 PM
Message: This is a great document, but IE and FireFox both try to format it differently and neither does a shrink/expand to fit correctly.

Subject: Re: Can the format be changed?
Posted by: Andrew Clarke (view profile)
Posted on: Tuesday, June 21, 2011 at 11:26 AM
Message: The PDF file which is format of the wallchart should work fine in any browser. If you're referring to the HTML file, this is there only so you can see what is in the PDF file. It is not meant for actual use, and does its best to render a Word file. For use, you'll need the PDF file.

Subject: Comment and sp_help and new document
Posted by: Dan F (not signed in)
Posted on: Thursday, June 23, 2011 at 1:43 AM
Message: The comment command is CTRL+K, CTRL+C on my machine. Not sure if that's because I also have Visual Studio. CTRL+K, CTRL+U is uncomment.

Missing one of my faves - select some kind of identifier and ALT+F1 - shortcut for sp_help I believe.

Anybody know where/what the shortcut for New Document is these days? It used to be ye olde standard Ctrl+N, but that stopped working for me "a while ago" and I don't know why - if it's deliberate on MS's behalf, or if my machine(s) are broken

Subject: Nice collection, but...
Posted by: Antony (not signed in)
Posted on: Friday, June 24, 2011 at 1:44 AM
Message: This is entirely dependant on the keyboard scheme selected in SSMS settings, and the version of management studio used - what version/scheme does this apply to?

Subject: DBA with a small team of Analysits
Posted by: David (view profile)
Posted on: Friday, June 24, 2011 at 2:19 AM
Message: My team love this wall chart.

Althought, I'm getting a little bit of bored of sentences that start "did you know...".
;P

Subject: Useful for developers
Posted by: Nitin (not signed in)
Posted on: Friday, June 24, 2011 at 3:25 AM
Message: As a Software engineer ...nice to have practise on keyboard to speed up the work.

Very Useful Information....

Subject: Missing key
Posted by: Raghuveeer (not signed in)
Posted on: Friday, June 24, 2011 at 4:29 AM
Message: Thanks and its Good

To go next or prev tab query window

Ctrl+Tab
Ctrl+Shift+Tab

Subject: Re: Missing key
Posted by: Andrew Clarke (view profile)
Posted on: Friday, June 24, 2011 at 4:58 AM
Message: Ah. You're right. This now works again like good old Query Analyzer if you press them and release them together (like piano keys, without holding down the Control) I'll need to add them into the next edition.

Subject: Re: Nice collection, but.
Posted by: Andrew Clarke (view profile)
Posted on: Friday, June 24, 2011 at 5:00 AM
Message: we cover the latest version of SSMS, and we didn't include the old Query Analyser layout. You'll have to go back to BOL for that. There was a certain struggle to fit as much as possible on one page!

Subject: Thanks
Posted by: J Freeman (not signed in)
Posted on: Friday, June 24, 2011 at 6:08 AM
Message: Simple, helpful tips like this are most appreciated especially for those who are no as technically savvy as some. Thanks loads

Subject: Block comments
Posted by: Marc (view profile)
Posted on: Friday, June 24, 2011 at 7:56 AM
Message: Ctrl + K,C and Ctrl + K,U are must haves! I use these hourly! F5 I use minutely.

I'm not sure if you really need the standard commands here, such as Alt+F4, text selection tools, etc, as they are really standard in windows and perhaps you could put that space to better use?

Subject: Thanks
Posted by: J R (view profile)
Posted on: Friday, June 24, 2011 at 1:50 PM
Message: Love it! Thank you!

Subject: exec commented code
Posted by: FeMc (view profile)
Posted on: Monday, July 09, 2012 at 12:50 PM
Message: Hi. There is a way to select and execute a commented ( 2 dashes) block of code without having to uncomment it first. I cant recall how to do this. Does someone know or remember?

Thanks

Subject: The Wallchart
Posted by: Ken3 (view profile)
Posted on: Tuesday, November 26, 2013 at 10:50 AM
Message: This is wonderful, thank you!!

 

Phil Factor
Searching for Strings in SQL Server Databases

Sometimes, you just want to do a search in a SQL Server database as if you were using a search engine like Google.... Read more...

 View the blog

Top Rated

Searching for Strings in SQL Server Databases
 Sometimes, you just want to do a search in a SQL Server database as if you were using a search engine... Read more...

The SQL Server Sqlio Utility
 If, before deployment, you need to push the limits of your disk subsystem in order to determine whether... Read more...

The PoSh DBA - Reading and Filtering Errors
 DBAs regularly need to keep an eye on the error logs of all their SQL Servers, and the event logs of... Read more...

MySQL Compare: The Manual That Time Forgot, Part 1
 Although SQL Compare, for SQL Server, is one of Red Gate's best-known products, there are also 'sister'... Read more...

Highway to Database Recovery
 Discover the best backup and recovery articles on Simple-Talk, all in one place. Read more...

Most Viewed

Beginning SQL Server 2005 Reporting Services Part 1
 Steve Joubert begins an in-depth tour of SQL Server 2005 Reporting Services with a step-by-step guide... Read more...

Ten Common Database Design Mistakes
 If database design is done right, then the development, deployment and subsequent performance in... Read more...

SQL Server Index Basics
 Given the fundamental importance of indexes in databases, it always comes as a surprise how often the... Read more...

Reading and Writing Files in SQL Server using T-SQL
 SQL Server provides several "standard" techniques by which to read and write to files but, just... Read more...

Concatenating Row Values in Transact-SQL
 It is an interesting problem in Transact SQL, for which there are a number of solutions and... Read more...

Why Join

Over 400,000 Microsoft professionals subscribe to the Simple-Talk technical journal. Join today, it's fast, simple, free and secure.