Some of my favorite SSMS Keyboard shortcuts

11

July 29, 2015 by Kenneth Fisher

I love keyboard shortcuts. I recently mapped a keyboard shortcut to Change Connection and thought I would share some of my other favorites.

  • Shft+Arrow keys (sometimes + Ctrl): Highlight blocks of code. Adding in the control key moves you a word at a time rather than a single character. This one is a basic keyboard shortcut/command that is used before a bunch of the others.
  • Ctrl-C, Ctrl-V and Ctrl-X: Copy, paste and cut. I’m guessing most, if not everyone, reading this will already know about these but I use them so often I felt they deserved a mention.
  • Ctrl-Shft-U, Ctrl-Shft-L: Convert all of the highlighted text to upper case or lower case. If you are a formatting nut like me then you will probably find these particularly handy.
  • Ctrl-R: Hide or display the results pane. I sometimes hit this one by reflex trying to expand my work space (by hiding the results pane) without noticing the fact that the results pane was already closed.
  • Ctrl-T & Ctrl-D: Shift between text output and grid output. I like the grid output in general but need the text output when I’m using things like sp_helptext.
  • Ctrl-K then Ctrl-C, Ctrl-K then Ctrl-U: These comment or un-comment every line highlighted or partially highlighted.
  • Ctrl-E: Execute the currently selected text or all of the text in the query pane if nothing is selected.
  • Ctrl-Z, Ctrl-Y: Undo and redo changes.

 
And here are my top two favorites currently. The first one I learned recently and was the inspiration for this post and the second I actually learned while writing it.

  • ALT: Used with the mouse or with shift+arrow keys it lets you select a vertical line or a block. From that point you can type the same thing to multiple lines or copy and paste blocks of code. See an awesome example by Erik Darling (b/t) of this here.
  • Ctrl+Space: Open up a context sensitive suggestions dropdown. Type USE then Ctrl+Space in the space after it to see what I mean. For someone working with a lot of instances where you can’t remember all the database names (or table names for that matter) this is going to save me some time! From what I can tell this is SSMS 2012 and up

This is by no means the complete list. This is just a short list of some of my favorites. For a more complete list follow this link: SSMS: The Query Window Keyboard Shortcuts

11 thoughts on “Some of my favorite SSMS Keyboard shortcuts

  1. notarian says:

    Ctrl-E was the way in ISQLW but I have finally started using F5 🙂

  2. Lee Everest says:

    My fav of all-time was ctl+B do u remember that one pre-SSMS? You could grab the results separator pane and make larger/smaller on the fly. Kinda hard to describe, but was slick!

    Take care,
    Lee Everest

  3. mtormos says:

    Once again, some good stuff here. LOVE keyboard command shortcuts. Being in the middle of writing something in SSMS then having to stop to use the mouse kinda destroys the rhythm. Thanks again.

  4. barry says:

    Shift + Tab (Decrement Indentation)….little known for formatting adjustments.

  5. Hakim Ali says:

    Some more that I use all the time:

    CTRL + G: goto line number
    Shift + Alt + Return for full screen text editing (repeat to toggle)
    CTRL + UP/DOWN: vertical scrolling
    CTRL + HOME/END: start/end of script
    F6 and SHIFT + F6: move cursor into and out of results grid
    CTRL + N: new query
    CTRL + TAB: jump between query windows
    SHIFT + DELETE: delete entire current line
    CTRL + F: find
    CTRL + F3: instant find
    SHIFT + F3: find backwards
    CTRL + H: replace
    Highlight table/stored proc/function name then ALT + F1 for object metadata

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 1,614 other followers

Follow me on Twitter

ToadWorld Pro of the Month November 2013
%d bloggers like this: