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!

 

 

 

 

 

 

Teaching is Learning, or How to Survive the SQL Server Learning Curve

teaching-learningDan Crisan, @dandancrisan, a full-time student and tech blogger, has stumbled upon a great way to learn new material — and that’s to write about it. He did just that, taking the material from his Intro to Database Systems course and crafting it into a series of postings called “A Tiny Intro to Database Systems”, http://blog.dancrisan.com/a-tiny-intro-to-database-systems.

Learning by teaching is not a new concept. Dan explained how he stumbled upon Daniel Lemire’s blog posting “How to Learn Efficiently” (http://lemire.me/blog/archives/2014/12/30/how-to-learn-efficiently/), in which Lemire states: “[W]riting … would be a very effective way to learn the material. Teaching is a great way to learn, because it challenges you.” This, in itself, is a good blog, and if you’re like the majority of SQL Server DBAs, always on a continuous learning curve(will Microsoft never give us a moment to relax? I just got a copy of the SQL Server 2016 data sheet from the Ignite conference in Chicago! (And thinking about the continuous learning curve, this gives SQL Server’s “Always On” a whole new meaning…) Argh!), adopting this learning style may be a big help when trying to assimilate the newest, brightest and best features of SQL Server.

A little history about Ted Codd's relational model, circa 1970, http://www-03.ibm.com/ibm/history/ibm100/us/en/icons/reldb/

A little history about Ted Codd’s relational model, circa 1970, http://www-03.ibm.com/ibm/history/ibm100/us/en/icons/reldb/

Where was I?  Oh yes — the purpose of this posting is to point you to a sweet space where you can quickly review what you learned in database class all those years ago. The dashboard site to “A Tiny Intro to Database Systems” is not the place to learn about databases for the first time. Rather, it’s the place to go for a refresher, a review of concepts and terminology that we all knew at one time but have forgotten in the crush of everyday business.

And why bother to review? Because every now and then it’s good to go back to the beginning, to understand why SQL Server and it’s relational counterparts are so valuable. The material presented in these tiny overviews is not specific to SQL Server, but in most cases it’s the way SQL Server works underneath the hood. So grab your sandwich and spend a lunchtime with this walk down memory lane.

Thanks for reading. I publish links to everything I write (my blog, my SQL DBA Knowledge Base, and my LinkedIn Publishing) on my Facebook page, visit it for more goodies. Please like, comment, and share.

https://www.facebook.com/MountVernonDataSystems?ref=hl

Michelle Poolet, Zachman-Certified™ Enterprise Architect
Michelle@MountVernonDataSystems.com
@SQLinTheCloud