SQL SERVER – Query Shortcuts

One of my clients who hired me for the Comprehensive Database Performance Health Check got very impressed that I was able to use efficiently query shortcuts. Let us learn about them today.

SQL SERVER - Query Shortcuts queryscs-800x451

 

My client was very impressed that without typing any commands I was able to retrieve locking information as well as active processes in the SQL Server. The reality was that I was using SSMS Query Shortcuts. This is a very underutilized feature of SQL Server Management Studio.

In SSMS, go to Menu >> Tools >> Options >> Keyboard >> Query Shortcut.

SQL SERVER - Query Shortcuts keyboardsc0

Over here you will see the list of the query shortcuts. You can see that there are three shortcuts that are already assigned.

  1. ALT +F1 – sp_help –
  2. CTRL + 1 – sp_who –
  3. CTRL + 2 – sp_lock –

Over here, you will notice that there are quite a few shortcuts available for free to execute Stored Procedures. You can edit them with your desired stored procedure or any other system stored procedure.

For example when you want to see the information for any table. You can just select that table and click on ALT+F1 on the keyboard and it will show up all the help related to the table. Essentially when ALT + F1 is pressed by selecting the table name, it actually executes the following script.

sp_help TableName

SQL SERVER - Query Shortcuts keyboardsc1

Personally, I use this feature very much but I have seen very little adoption in the industry and I am hoping that it will increase with time. I will also create a SQL in the Sixty Seconds video in the future.

Reference: Pinal Dave (https://blog.sqlauthority.com) 

SQL Server, SQL Server Management Studio, SQL Shortcut, SSMS
Previous Post
SQL SERVER – Network Port Used
Next Post
SQL SERVER – Writing Infinite Loop

Related Posts

Leave a Reply