Blog image

SQL Server Management Studio Keyboard Shortcuts

MouseAre you an impatient DBA?  Does it make you crazy to have to mouse around the SQL Server Management Studio dashboard?  Wouldn’t it be nice to know the keyboard shortcuts that can make you go faster?

Back in “the day” we knew that REAL computer people use a keyboard, not a mouse. Mice were for those Apple folk…

And how about SSMS’s split screen — does that ever annoy you?  When you’re working on a big query, and you want to see as much of it as you can, or you want to see as much of the result set as you can fit on a screen, do you know how to make that happen?

And talking about working on big queries, wouldn’t it be nice to see the line numbers in the code? Like, when you were doing procedural programming? Remember those days?

Here ya go…first, the SSMS keyboard shortcuts

http://am2.co/wp-content/uploads/ShortcutsCheatSheet.pdf to download a cheat sheet that I found at http://am2.co/2016/03/shortcuts-cheat-sheet/, Andy Mallon’s blog site. It’s a fun read, and the comments add another handful of keyboard shortcuts — both for SSMS and for Windows.

Next, to avoid the SSMS split screen:

SSMS no split screen

From the top command bar, select Tools > Options

Choose Query Results > SQL Server > Results to Grid, and check “display results in a separate tab”.   If you want to auto-switch to the results tab immediately after executing the query, also check “switch to the results tab after the query executes”.

Click OK to save changes.

NOTE: this will not take effect on any existing query screens that you have open. The next New Query you open, however, will display the new behaviour.

Line Numbers:

Line Numbers

Open SSMS

From the top command bar, select Tools > Options

Choose Text Editor > Transact-SQL > General

Click “line numbers”

Click OK to save changes.

Highlighting:

while we’re at it, are you tired of that blue (or grey) highlighting when in query mode? How about changing the color of highlighted areas to yellow, for instance? Easy ‘nuf!

Highlighting

Open SSMS

From the top command bar, select Tools > Options

Choose Environment > Fonts and Colors

Under “Display Items” highlight “Selected Text”

Use the “Item Background” drop-down list to choose a new color. The sample window is very useful to see what the result will look like before you commit (you can drive someone crazy if you change their selected text background to white or black…but don’t tell them where you found out where to do this!)

Click OK to save changes.

And finally, my favorite…executing a query WITHOUT having to mouse over to the red ! icon, or using the “piano stretch” FN-F5.  ALT-X executes the highlighted query.

There’s no reason why you can’t have fun when working with SSMS. Some of these changes actually make you more productive, too…imagine that! Fun and gets things done — is there anything better?

Let’s stay connected. LIKE me on Facebook. Follow my Tweets. Connect with me on LinkedIn. And make it a great day!