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.
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.
Over here you will see the list of the query shortcuts. You can see that there are three shortcuts that are already assigned.
- ALT +F1 – sp_help –
- CTRL + 1 – sp_who –
- 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.
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)