SQL Server Management Studio, also known as SSMS is an essential tool for Microsoft SQL Server developers as well as any full-stack Java developer whose application is using SQL Server database in the backend. It allows you to connect to the MSSQL database, execute SQL queries, check execution plan, see table and schema detail, writing and debugging stored procedures, and many more features. Imagining life without SSMS for SQL Server DBA and developer is impossible.
Since many Java and SQL developer spends a lot of time on this great tool, you can increase productivity by learning some keyboard shortcuts. This will not only improve your productivity but also make working in SSMS fun.
By the way, if you are new to Microsoft SQL Server and T-SQL then I also suggest you join a comprehensive course to learn SQL Server fundamentals and how to work with T-SQL.
By the way, if you are new to Microsoft SQL Server and T-SQL then I also suggest you join a comprehensive course to learn SQL Server fundamentals and how to work with T-SQL.
If you need a recommendation then I suggest you go through these best SQL Server online courses on Udemy. It's a great course to start with T-SQL and SQL queries in SQL Server.
15 SQL Server Management Studio Keyboard Shortcuts
Here is my list of top 10 SQL Server Management Studio shortcuts, which you can use to improve your productivity and work faster in SQL Server.1. Ctrl + N top open a new query window with the current connection
This will open a new query window for you
2. Ctrl + Tab to switch between open tabs
2. Ctrl + Tab to switch between open tabs
If you have multiple query tabs open then you can use Ctrl + Tab to switch between them.
3. Ctrl + R to show and hide result panel
4. Ctrl + E to execute highlighted SQL statements
You can also use F5 to execute the selected SQL query but if you have not selected anything then F5 will execute the whole panel.
5. Ctrl + Shift + U to make selected SQL query into upper case
6. Ctrl + Shift + U to make selected SQL query into lower case
7. Ctrl + L to display the estimated execution plan
8. Ctrl + M to include the actual execution plan
9. Ctrl + Space + Tab for content assist using Intellisense
10. Ctrl + G to go any line
11. Ctrl + K + C to comment selected block of SQL statements
You can also use Ctrl + K + U to an un-comment the selected blocks of SQL statements.
12. Alt + break to cancel currently running an SQL query
13. ALT + F1 to display details of the highlighted table.
You can use this shortcut to select a table and check its details like columns, their type, size, constraints, and index details. Alternatively, you can also use exec sp_help table name, but for that, you must select the right schema first sp_help Schema..tablename doesn't work.
3. Ctrl + R to show and hide result panel
4. Ctrl + E to execute highlighted SQL statements
You can also use F5 to execute the selected SQL query but if you have not selected anything then F5 will execute the whole panel.
5. Ctrl + Shift + U to make selected SQL query into upper case
6. Ctrl + Shift + U to make selected SQL query into lower case
7. Ctrl + L to display the estimated execution plan
8. Ctrl + M to include the actual execution plan
9. Ctrl + Space + Tab for content assist using Intellisense
10. Ctrl + G to go any line
11. Ctrl + K + C to comment selected block of SQL statements
You can also use Ctrl + K + U to an un-comment the selected blocks of SQL statements.
12. Alt + break to cancel currently running an SQL query
13. ALT + F1 to display details of the highlighted table.
You can use this shortcut to select a table and check its details like columns, their type, size, constraints, and index details. Alternatively, you can also use exec sp_help table name, but for that, you must select the right schema first sp_help Schema..tablename doesn't work.
Similarly, this shortcut will also not work if the selected table is not under a selected database like it will give the following error
The object 'BookDetail' does not exist in database 'Books' or is invalid for this operation
The object 'BookDetail' does not exist in database 'Books' or is invalid for this operation
14. Ctrl + U to change the current database
Once you are in Query windows of SQL Server management studio you can press Ctrl + U to select the current database combo box. Later you can use the up and down arrow to change the current database, quite useful if you are switching between different databases quite often.
15. TAB and SHIFT TAB to increase and decrease indentation
One of the key things to improve the readability of long and complex SQL queries is proper indentation. You can use TAB and SHIFT TAB keys to increase and decrease the indentation of your SQL statements.
16. Few more Shortcuts
CTRL+A to select all the text in the current query window
CTRL+C to copy selected text
CTRL+V to paste text
CTRL+X to cut selected text
DEL to delete text
CTRL+P to launch a Print dialog box
CTRL+HOME to go to the beginning of the query window
CTRL+END to go to the end of the query window
CTRL+SHIFT+HOME to select all text from the current location to the beginning of the query window
CTRL+SHIFT+END to select all the text from the current location to the end of the query window
ALT+F4 to close SSMS
CTRL+C to copy selected text
CTRL+V to paste text
CTRL+X to cut selected text
DEL to delete text
CTRL+P to launch a Print dialog box
CTRL+HOME to go to the beginning of the query window
CTRL+END to go to the end of the query window
CTRL+SHIFT+HOME to select all text from the current location to the beginning of the query window
CTRL+SHIFT+END to select all the text from the current location to the end of the query window
ALT+F4 to close SSMS
That's all about the 15 essential SQL Server Management Studio (SSMS) keyboard shortcuts. You can use these shortcuts to improve your productivity and also enjoy working on SQL Server Management Studio.
Believe me, spending some time on learning tools that we use on a day-to-day basis is the best thing you can do. It pays a huge reward in long run. You not only become better at your job but also start having fun as you have more control of the things you do.
Other SQL and Interview Question Articles You may like to explore
- Top 5 Courses to learn SQL and Database for Beginners
- 10 Free Courses to learn SQL and Database
- 50+ Microsoft SQL Server Phone Interview questions
- 10 Oracle Interview Questions with Answers
- Top 5 Advanced SQL Books for Programmers
- 5 Free T-SQL and SQL Server Courses for Programmers and DBAs
- Top 5 Courses to learn MySQL Database
- Top 5 Books for Database Design and Modeling
- Top 5 Courses to learn PostgreSQL in depth
- 10 Free Courses to learn Oracle and MSSQL
Thanks for reading this article so far. If you like this article then please share it with your friends and colleagues. If you have any questions or feedback then please drop a note.
P. S. - If you are new to SQL and Databases in general and want to learn DB fundamentals and SQL basics before deep dive on PostgreSQL then you can also check out this list of free Websites to learn SQL and databases for beginners.
P. S. - If you are new to SQL and Databases in general and want to learn DB fundamentals and SQL basics before deep dive on PostgreSQL then you can also check out this list of free Websites to learn SQL and databases for beginners.
No comments:
Post a Comment