Useful SQL Server Management Studio (SSMS) Keyboard Shortcuts

May 9, 2017
Keyboard shortcuts play an important role in increasing the productivity of any development environment. There are myriad shortcuts that are highly beneficial in SQL Server Management Studio (SSMS), and SSMS also allows you to easily add your own keyboard shortcuts. In this article, we show you several...

By: Matt Wollner

 
 

Keyboard shortcuts play an important role in increasing the productivity of any development environment. There are myriad shortcuts that are highly beneficial in SQL Server Management Studio (SSMS), and SSMS also allows you to easily add your own keyboard shortcuts.

Using a keyboard shortcut in SSMS will add the given code before any SQL that you highlight. Two shortcuts that I add to my SSMS instance are:

SELECT TOP 1000 * FROM

SELECT COUNT(*) FROM

This is simple to set up in SSMS 2005/2008.

  1. Tools -> Options
  2. Environment -> Keyboard
  3. Add the following shortcuts to the Query Shortcuts. I set the SELECT* as the Ctrl+5 because execute is F5, so it is easy to remember. Make sure you include a space after the FROM.
    • Ctrl+5: SELECT TOP 1000(*) FROM
    • Ctrl+6: SELECT COUNT(*) FROM
  4. After you apply the changes, make sure you open a new session.
SQL keyboard shortcut

 

Now that the shortcuts have been setup, all I need to do to get a SELECT TOP 1000 (*) FROM a table is highlight the table name and hit Ctrl+5.

SQL keyboard shortcut code

 

You can also highlight additional code. The shortcut will just append the shortcut text before the highlighted code. In the example below I select the table, an inner join, and a where clause and hit Ctrl+5

 SQL keyboard shortcut code

 

Here are some additional shortcuts in SSMS that I find very handy:

Ctrl+R: Hide Show Result Pain

ATL+Q – C – H: Change Connection. (Open Query Window – Connection – Change Connection…)

Ctrl+Shift+R: Refresh the IntelliSense Cache

 

Keep your data analytics sharp by subscribing to our mailing list

Get fresh Key2 content around Business Intelligence, Data Warehousing, Analytics, and more delivered right to your inbox!

 
 
 
 
 


Key2 Consulting is a data warehousing and business intelligence company located in Atlanta, Georgia. We create and deliver custom data warehouse solutions, business intelligence solutions, and custom applications. 

Related Content
Rebuilding Indexes Based on Partition 

Rebuilding Indexes Based on Partition 

Author: Austin Dolezal Many businesses are wasting time and money cleaning up their data when small fixes and tweaks could optimize their processing time and storage space.  Database indexes and partitions are often created and...

5 Key Takeaways From PASS Data Community Summit 2022

5 Key Takeaways From PASS Data Community Summit 2022

The PASS Data Community Summit 2022 was a blast! A handful of people from our company attend the conference every year and this year was no exception. The knowledge gained, connections made, and fun enjoyed in Seattle is always worth the investment. Here are our five...

How to Delete Data From a Large Partitioned Table

How to Delete Data From a Large Partitioned Table

By: Ken Adams   The Problem I recently ran across an issue on a project that required a large amount of data to be removed from a table, specifically an issue with the loading of the table causing duplication of data. All non-clustered indexes had been removed...