11 Keyboard Shortcuts Every SQL Server Geek Should Know
A smart programmer knows the ins and outs of the IDE in which he works. Keyboard shortcuts save a lot of time and can improve productivity as well. SQL server Management Studio has included over 100 keyboard shortcuts. Here, we will explore the most essential shortcuts which will make our daily programming life more easy and intuitive.
1. Open a new Query Window with current connection (Ctrl + N)
This shortcut opens up a new query window with an existing connection. It will query to the same database the current query window does.
2. Toggle between opened tabs (Ctrl + Tab)
This combination will help you switch between multiple opened tabs.
3. Show/Hide Results pane (Ctrl + R)
If you have more lines of code in SQL Server after executing the query, the Results pane covers most of the window, so you need to scroll down continuously. Using this combination, you can save a lot of time.
4. Execute highlighted query (Ctrl + E)
Hold this key combination, and execute the highlighted query to see the results.
5. Cancel the executing query (Alt + Break or Alt + Scroll Lock)
Many times, we run the wrong query, and it may take time to show the results. Using this key pair, we can cancel the executing query quickly.
6. Make selected text uppercase or lowercase (Ctrl + Shift + U, Ctrl + Shift + L)
Formatting code has always been a tough job for programmers. If you want to make a part of a query uppercase or lowercase, this key pair works well.
7. Display estimated execution plan (Ctrl + L)
Working on slow running queries always requires taking a look at the estimated execution plan.
8. Include actual execution plan (Ctrl + M)
The same goes with an actual execution plan.
9. Intellisense list member and complete word (Ctrl + Space, Tab)
Microsoft’s Intellisense feature is a programmer’s delight. Suggestions like table names, columns and other information help programmers to write faster code. Using Ctrl + Space will give us suggestions, and using Tab, we can complete that suggestion.
10. Go to line (Ctrl + G)
When trying to solve errors in a very long query, you need the error message which indicates the line number. Using this key combination, you can quickly jump onto that line.
11. Comment and uncomment lines of code ( Ctrl + K & Ctrl + C; Ctrl + K & Ctrl + U)
Most of the time, programmers debug their code, and to do it faster, we keep commenting and uncommenting on a few lines of code. This key pair works perfectly for it.
Go through our SQL Server archives to find out more useful tips for SQL Server geeks.
Follow the reactions below and share your own thoughts.