- The five to learn first: F5 runs the query (or the selection), Alt+Break cancels it, Ctrl+L shows the estimated plan, Ctrl+M includes the actual plan, Ctrl+R hides or shows the results pane.
- Comment and uncomment with the chords Ctrl+K, Ctrl+C and Ctrl+K, Ctrl+U; refresh IntelliSense after schema changes with Ctrl+Shift+R.
- Ctrl+Shift+C copies the results grid with headers; Ctrl+D, Ctrl+T and Ctrl+Shift+F switch output to grid, text or file.
- SSMS is Windows only, so there are no macOS key bindings; shortcuts follow the Visual Studio-based default scheme and can be changed in Tools > Options.
SSMS shortcuts for running queries and execution plans
| Action | Shortcut |
|---|---|
| Run the selection, or the whole query window if nothing is selected | F5 |
| Parse (check syntax) without running | Ctrl+F5 |
| Cancel the executing query | Alt+Break |
| Display the estimated execution plan | Ctrl+L |
| Include the actual execution plan in the output | Ctrl+M |
| Open a new query with the current connection | Ctrl+N |
| Specify values for template parameters | Ctrl+Shift+M |
| Display the Query Designer from the query editor | Ctrl+Shift+Q |
| Run the sp_help system stored procedure | Alt+F1 |
| Run sp_who | Ctrl+1 |
| Run sp_lock | Ctrl+2 |
Results pane shortcuts
The output destination applies to the current query window from the next execution, so press the shortcut and then F5.
| Action | Shortcut |
|---|---|
| Output results in a grid | Ctrl+D |
| Output results as text | Ctrl+T |
| Output results to a file | Ctrl+Shift+F |
| Show or hide the results pane | Ctrl+R |
| Toggle between the query and results panes | F6 |
| Copy the result grid and headers to the clipboard | Ctrl+Shift+C |
Editing T-SQL
| Action | Shortcut |
|---|---|
| Comment the selected text | Ctrl+K, Ctrl+C |
| Uncomment the selected text | Ctrl+K, Ctrl+U |
| Make the selection uppercase | Ctrl+Shift+U |
| Make the selection lowercase | Ctrl+Shift+L |
| Increase indent | Tab |
| Decrease indent | Shift+Tab |
| Go to line | Ctrl+G |
| Undo | Ctrl+Z |
| Redo | Ctrl+Y or Ctrl+Shift+Z |
| Insert a blank line above the cursor | Ctrl+Enter |
| Insert a blank line below the cursor | Ctrl+Shift+Enter |
| Move the current line below the next line | Shift+Alt+T |
| Delete the word to the right / left of the cursor | Ctrl+Delete / Ctrl+Backspace |
| Delete whitespace in the selection or next to the cursor | Ctrl+K, Ctrl+\ |
| Save | Ctrl+S |
| Save all | Ctrl+Shift+S |
| Toggle outlining for the current block | Ctrl+M, Ctrl+M |
| Toggle all outlining | Ctrl+M, Ctrl+L |
Selecting text and column (box) selection
| Action | Shortcut |
|---|---|
| Select the whole document | Ctrl+A |
| Select the word at the cursor | Ctrl+W |
| Select to the start / end of the line | Shift+Home / Shift+End |
| Select to the start / end of the document | Ctrl+Shift+Home / Ctrl+Shift+End |
| Extend a column (box) selection up or down | Shift+Alt+Up Arrow / Shift+Alt+Down Arrow |
| Extend a column selection left or right | Shift+Alt+Left Arrow / Shift+Alt+Right Arrow |
| Navigate backward / forward in the editor history | Ctrl+- / Ctrl+Shift+- |
IntelliSense, snippets and search
| Action | Shortcut |
|---|---|
| List members (show completion list) | Ctrl+J |
| Refresh the IntelliSense local cache | Ctrl+Shift+R |
| Enable or disable IntelliSense | Ctrl+B, Ctrl+I |
| Insert a code snippet | Ctrl+K, Ctrl+X |
| Surround with a snippet | Ctrl+K, Ctrl+S |
| Code Snippet Manager | Ctrl+K, Ctrl+B |
| Find | Ctrl+F |
| Replace | Ctrl+H |
| Replace in files | Ctrl+Shift+H |
| Find next / previous | F3 / Shift+F3 |
Windows, tools and bookmarks
| Action | Shortcut |
|---|---|
| Object Explorer | F8 |
| Object Explorer Details | F7 |
| Registered Servers | Ctrl+Alt+G |
| Template Explorer | Ctrl+Alt+T |
| Solution Explorer | Ctrl+Alt+L |
| Properties window | F4 |
| Copilot in SSMS | Ctrl+Alt+C |
| Activity Monitor | Ctrl+Alt+A |
| SQL Server Profiler | Ctrl+Alt+P |
| Cycle through open windows | Ctrl+Tab / Ctrl+Shift+Tab |
| Close the current document window | Ctrl+F4 |
| Toggle full screen | Shift+Alt+Enter |
| Set or remove a bookmark on the current line | Ctrl+K, Ctrl+K |
| Next / previous bookmark | Ctrl+K, Ctrl+N / Ctrl+K, Ctrl+P |
| Clear bookmarks | Ctrl+K, Ctrl+L |
| Bookmarks window | Ctrl+K, Ctrl+W |
| Help for the current window | F1 |
Change keys and add your own query shortcuts
SSMS uses a keyboard scheme based on Visual Studio by default. To change the scheme, open Tools > Options and select Environment > Keyboard.
Alt+F1, Ctrl+1 and Ctrl+2 run system stored procedures. You can map other keys to stored procedures as query shortcuts: to add your own, open Tools > Options > Keyboard > Query Shortcuts, choose an unused combination in the Shortcut list, type the procedure name (for example sp_helpindex) in Stored Procedure, and select OK. SSMS 22.6.0 moved these settings to the new Unified Settings experience, and 22.8.0 fixed a bug that disabled this menu, so keep SSMS up to date if the page looks different.
Coming from Azure Data Studio or working on a Mac? The MSSQL extension for VS Code has its own key bindings; see SSMS for Mac: what to use instead in the related guides.
Frequently asked questions
What is the shortcut to execute a query in SSMS?
F5. It runs the selected text, or the whole query window if nothing is selected. Ctrl+F5 only parses the batch without running it.
How do I comment out multiple lines in SSMS?
Select the lines and press Ctrl+K, then Ctrl+C. To uncomment, press Ctrl+K, then Ctrl+U.
How do I show the execution plan with a shortcut?
Ctrl+L shows the estimated plan without running the query. Ctrl+M toggles including the actual plan, which appears after you run the query with F5.
How do I refresh IntelliSense after creating a table?
Press Ctrl+Shift+R to refresh the IntelliSense local cache, so new tables and columns appear in the completion list.
Are there SSMS shortcuts for Mac?
No. SSMS runs only on Windows. On macOS, VS Code with the MSSQL extension is Microsoft's supported tool, with its own shortcuts.
Sources
- Microsoft Learn: SQL Server Management Studio keyboard shortcuts
- Microsoft Learn: Query results in SQL Server Management Studio
- Microsoft Learn: Options (Environment - Keyboard page)
- Microsoft Learn: Customize menus and shortcut keys
- Microsoft Learn: SSMS 22 release notes
- Microsoft Learn: Tips and tricks for using SSMS
Checked 8 October 2026.
How we research tool guides: our editorial method. CodeWithSQL earns nothing from the vendors mentioned.