By: Greg Robidoux | Updated: 2006-07-05 | Comments | Related: > SQL Server Management Studio Shortcuts
Problem
Using Query Analyzer is a great tool for testing queries, running ad hoc queries, troubleshooting queries etc... There is a lot of functionality as well as a lot of shortcuts built into the tool, but finding the shortcuts or remembering them is sometimes not that easy.
Solution
Following are two tables of the shortcuts that you can use in Query Analyzer. The first chart is listed in Shortcut order and the second is listed in Function order. Once you are familiar with the shortcuts, they can save a lot of time and mouse clicks.
Shortcut | Function | Shortcut | Function | |
---|---|---|---|---|
ALT+BREAK | Cancel a query | CTRL+SHIFT+F2 | Clear all bookmarks | |
ALT+F1 | Database object information | CTRL+SHIFT+INSERT | Insert a template | |
ALT+F4 | Exit | CTRL+SHIFT+L | Make selection lowercase | |
CTRL+A | Select all | CTRL+SHIFT+M | Replace template parameters | |
CTRL+B | Move the splitter | CTRL+SHIFT+P | Open | |
CTRL+C | Copy | CTRL+SHIFT+R | Remove comment | |
CTRL+D | Display results in grid format | CTRL+SHIFT+S | Show client statistics | |
CTRL+Delete | Delete through the end of the line | CTRL+SHIFT+T | Show server trace | |
CTRL+E | Execute query | CTRL+SHIFT+U | Make selection uppercase | |
CTRL+F | Find | CTRL+T | Display results in text format | |
CTRL+F2 | Insert/remove bookmark | CTRL+U | Change database | |
CTRL+F4 | Disconnect | CTRL+V | Paste | |
CTRL+F5 | Parse query and check syntax | CTRL+W | Window selector | |
CTRL+G | Go to line | CTRL+X | Delete | |
CTRL+H | Replace | CTRL+Z | Undo | |
CTRL+I | Index Tuning Wizard | F1 | Help for Query Analyzer | |
CTRL+K | Display/hide execution plan | F2 | Move to next bookmark | |
CTRL+L | Display execution plan | F3 | Repeat last search | |
CTRL+N | New query window | F4 | Object Search | |
CTRL+O | Connect | F5 | Execute a query | |
CTRL+P | F6 | Switch between query and result panes | ||
CTRL+R | Show/Hide results pane | F8 | Show/hide Object Browser | |
CTRL+S | Save | SHIFT+F1 | Transact-SQL help | |
CTRL+SHIFT+0 | Show options | SHIFT+F2 | Move to previous bookmark | |
CTRL+SHIFT+C | Comment out code | SHIFT+TAB | Decrease indent | |
CTRL+SHIFT+DEL | Clear the active Editor pane | SHIFT+F6 | Switch panes | |
CTRL+SHIFT+F | Save results to file | TAB | Increase indent |
Function | Shortcut | Function | Shortcut | |
---|---|---|---|---|
Cancel a query | ALT+BREAK | Make selection uppercase | CTRL+SHIFT+U | |
Change database | CTRL+U | Move the splitter | CTRL+B | |
Clear all bookmarks | CTRL+SHIFT+F2 | Move to next bookmark | F2 | |
Clear the active Editor pane | CTRL+SHIFT+DEL | Move to previous bookmark | SHIFT+F2 | |
Comment out code | CTRL+SHIFT+C | New query window | CTRL+N | |
Connect | CTRL+O | Object Search | F4 | |
Copy | CTRL+C | Open | CTRL+SHIFT+P | |
Database object information | ALT+F1 | Parse query and check syntax | CTRL+F5 | |
Decrease indent | SHIFT+TAB | Paste | CTRL+V | |
Delete | CTRL+X | CTRL+P | ||
Delete through the end of the line | CTRL+Delete | Remove comment | CTRL+SHIFT+R | |
Disconnect | CTRL+F4 | Repeat last search | F3 | |
Display execution plan | CTRL+L | Replace | CTRL+H | |
Display results in grid format | CTRL+D | Replace template parameters | CTRL+SHIFT+M | |
Display results in text format | CTRL+T | Save | CTRL+S | |
Display/hide execution plan | CTRL+K | Save results to file | CTRL+SHIFT+F | |
Execute a query | F5 | Select all | CTRL+A | |
Execute query | CTRL+E | Show client statistics | CTRL+SHIFT+S | |
Exit | ALT+F4 | Show options | CTRL+SHIFT+0 | |
Find | CTRL+F | Show server trace | CTRL+SHIFT+T | |
Go to line | CTRL+G | Show/hide Object Browser | F8 | |
Help for Query Analyzer | F1 | Show/Hide results pane | CTRL+R | |
Increase indent | TAB | Switch between query and result panes | F6 | |
Index Tuning Wizard | CTRL+I | Switch panes | SHIFT+F6 | |
Insert a template | CTRL+SHIFT+INSERT | Transact-SQL help | SHIFT+F1 | |
Insert/remove bookmark | CTRL+F2 | Undo | CTRL+Z | |
Make selection lowercase | CTRL+SHIFT+L | Window selector | CTRL+W |
Next Steps
- Bookmark this tip for a quick reference to the Query Analyzer shortcuts
- Get familiar with the shortcuts and take advantage of some the ones you didn't know existed
About the author
This author pledges the content of this article is based on professional experience and not AI generated.
View all my tips
Article Last Updated: 2006-07-05