If you regularly execute queries such as:
in SQL Server Management Studio (SSMS), then you would be sick of repeating them.
You can assign your own keyboard shortcuts to frequently used SQL snippets in SSMS, did you know?
In this guide, we’ll walk through how to configure these shortcuts and speed up your SQL workflow.
Why Use Keyboard Shortcuts in SSMS?
- Custom shortcuts can help you:
- Save time on repetitive tasks
- Reduce typing errors
- Improve productivity when navigating databases
Any other SQL command or snippet
Add Keyboard Shortcuts in SSMS guide step by step :
Step 1: Open Options in SSMS
In SSMS, go to the Tools menu.
Click on Options.
Click on the Environment section to expand.
Click on Keyboard > Query Shortcuts.
You'll find here a list of 9 keyboard shortcuts that can be customized:
Shortcut\tDefault Action
Ctrl + 1\tsp_help
Ctrl + 2\tsp_who
Ctrl + 3\t(empty)
.
Step 2: Add Your Custom Query
You can put any SQL code snippet here. For example:
Step 3: Apply the Shortcut
Now, in any query window:
Type the name of the table or stored procedure (e.g. Employees)
Select the name
Press the shortcut (e.g. Ctrl + 3)
Example:
Tips :
Shortcuts operate on chosen text — always select the object name to start with.
You may overwrite existing shortcuts if you never use them (such as Ctrl + 2 for sp_who).
You may assign shortcuts to:
How to Reset Shortcuts
To reset to defaults:
Navigate to Tools > Options > Keyboard > Query Shortcuts
Press Reset
This will restore default sp_help and sp_who mappings.
🙏 Thank You for Reading!
Thank you for taking the time to read this blog!
If you have any questions or need help with something, feel free to drop a message in the comments or contact section. I’ll get back to you as soon as possible.
Happy Learning! 😊