Query shortcuts in SQL Server Management Studio

Tired of typing out the same queries day after day? Well query shortcuts in SSMS are for you!

Following on from my last post Changing connection colours in SSMS I thought I’d write another quick about this cool but also often unused feature in SSMS.

These shortcuts allow you to run pre-determined queries by assigning a hot key within SSMS. To do this in SSMS go to Tools > Options > Environment > Keyboard

queryshortcuts2

From there you can set the query to the hot key you want to use. Nice and easy!

In nearly all of the instances of SQL Server that I look after, I’ve installed Adam Machanic’s excellent sp_whoisactive. By adding the above shortcut into SSMS I can run it quickly and easily in any instance that I’ve connected to. It’s really handy and I’d definitely recommend you install it and set a query shortcut up for it.

Thanks for reading!

2 thoughts on “Query shortcuts in SQL Server Management Studio

  1. This is a great feature of query shortcuts. I inserted the text ‘Select * from ‘ in the Shortcut “Cntrl + 3” text box so that I can highlight a table name in any query window, press the combination Cntr + 3 to retrieve a recordset of the highlighted table.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s