SSMS: The Query Window Keyboard Shortcuts

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 at the bottom 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 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.



Tags: , , ,


  • Rate
    [Total: 2    Average: 4/5]
  • Khalid F

    Thanks for going to the effort to create this. Much appreciated! Gotta love the shortcuts…

  • DrFooMod2

    Block Comment
    You forgot Ctrl+K, Ctrl+D for comment line (or block) and Ctrl+K, Ctrl+U to uncomment.

  • JustMe

    Current Query – Excecute
    Alt-X will also Execute the Current Query. Easy to remember X = Execute.

  • Andrew Clarke

    Block Comment and Current Query Execute
    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-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?

  • Steve Durette

    Can the format be changed?
    This is a great document, but IE and FireFox both try to format it differently and neither does a shrink/expand to fit correctly.

  • Andrew Clarke

    Re: Can the format be changed?
    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.

  • Dan F

    Comment and sp_help and new document
    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

  • Antony

    Nice collection, but…
    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?

  • David

    DBA with a small team of Analysits
    My team love this wall chart.

    Althought, I’m getting a little bit of bored of sentences that start “did you know…”.

  • Nitin

    Useful for developers
    As a Software engineer …nice to have practise on keyboard to speed up the work.

    Very Useful Information….

  • Raghuveeer

    Missing key
    Thanks and its Good

    To go next or prev tab query window


  • Andrew Clarke

    Re: Missing key
    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.

  • Andrew Clarke

    Re: Nice collection, but.
    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!

  • J Freeman

    Simple, helpful tips like this are most appreciated especially for those who are no as technically savvy as some. Thanks loads

  • Marc

    Block comments
    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?

  • J R

    Love it! Thank you!

  • FeMc

    exec commented code
    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?


  • Ken3

    The Wallchart
    This is wonderful, thank you!!

  • Phaneendra

    Using them from this moment
    Really useful.
    Going to use from this moment…