In this article, we are going to see some shortcuts that may be useful to you when you work with SQL Server Management Studio. You can always use some custom queries as query shortcuts in SSMS.
You can create shortcuts for frequently used queries in Management Studio, some of the shortcuts are predefined, like pressing “Ctrl + 1” will execute “sp_who”. You can create shortcuts for your own queries or change the existing shortcuts. Here I am going to show some of the most used queries shortcuts. I hope you will like this.
To create a new shortcut, go to Tools > Options > Environment > Keyboard in Management Studio.
For example, you can create a shortcut for:
Now I am Adding my regular two shortcuts
- ctrl+3 for count of rows
- ctrl+4 for select statement
I have added my shortcuts in Query shortcuts panel under ctrl+3 and ctrl+4 and click ok.
Note: Before you can use this shortcut you will need to restart Management Studio or close current query window and reopen it.
To execute above shortcuts use below procedure:
- Type fully qualified table name, e.g. Database.Schema.Table
- Highlight the name and press “Ctrl + 3” (or the key you have assigned in your Shortcuts environment)
For Example here my table name is Customer.
select Customer and press Assigned shortcut key (ctrl+4)
here is another example i want to get count of rows in table
for doing this just select table name and press Assigned shortcut key (ctrl+3)
Did I miss anything that you may think would help? Did you find this post as useful? I hope you liked the article. Please share your valuable suggestions and feedback in the comments.