SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Some of my favorite SSMS Keyboard shortcuts

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

Filed under: Microsoft SQL Server, SQLServerPedia Syndication, SSMS Tagged: keyboard shortcuts, microsoft sql server, SSMS


My name is Kenneth Fisher and I am Senior DBA for a large (multi-national) insurance company. I have been working with databases for over 20 years starting with Clarion and Foxpro. I’ve been working with SQL Server for 12 years but have only really started “studying” the subject for the last 3. I don’t have any real "specialities" but I enjoy trouble shooting and teaching. Thus far I’ve earned by MCITP Database Administrator 2008, MCTS Database Administrator 2005, and MCTS Database Developer 2008. I’m currently studying for my MCITP Database Developer 2008 and should start in on the 2012 exams next year. My blog is at www.sqlstudies.com.


Leave a comment on the original post [sqlstudies.com, opens in a new window]

Loading comments...