Some of my favorite SSMS Keyboard shortcuts
11July 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
Ctrl-E was the way in ISQLW but I have finally started using F5 🙂
I still use Ctrl-E but mostly out of habit and seeing no reason to change.
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
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.
Glad you liked it. I agree. I’m a big fan of keyboard shortcuts myself.
Shift + Tab (Decrement Indentation)….little known for formatting adjustments.
You know, I know that one and use it all the time but I didn’t think to include it. Thanks for the addition.
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
Nice list. A few of those are new to me. I’ll have to give them a shot.
SHIFT + DELETE doesn’t just delete the line — it Cuts it. So be careful — this is great for moving text around, and removing entire lines, but you’ll lose what’s in your clipboard at the same time.
Actually I’ve got a post coming up on that subject in a week or two. Next time try Ctrl-Shft-V (hit it more than once) to cycle through the clipboard ring.