SQL document keyboard shortcuts

Use the following keyboard shortcuts when working with a SQL document or stored procedure.

Execution

Name Keyboard shortcut Description
Execute F5 Executes a query associated with the current document.
Execute Current Statement F8 Executes the current statement at the cursor position.
Analyze Code Ctrl+K,A Runs T-SQL Analyzer on the current script.
  Ctrl+L Deletes the current line and copies it to the clipboard.
  Ctrl+W Closes the active document tab.
  Ctrl+N Opens a new document tab inheriting the server and database of the current one.

Navigation

Name Keyboard shortcut Description
Previous SQL Ctrl+Shift+Up Arrow Navigates to the previous SQL statement in the execution history.
Next SQL Ctrl+Shift+Down Arrow Navigates to the next SQL statement in the execution history.
SQL History Ctrl+Alt+H Open the Query History dialog.
  Ctrl+F2 Moves to the Navigation Bar.
  Ctrl+Alt+Page Up Switches to the previous open document tab.
  Ctrl+Alt+Page Down Switches to the next open document tab.
Go To Definition F12 Navigates to the definition of the selected object.
  Ctrl+R Shows or hides additional document views.

Editing mode and parameters

Name Keyboard shortcut Description
Edit Parameters Ctrl+Shift+P Edits parameters for the current query.
Redirect Data To Output Window Ctrl+Shift+T Shows query results as plain text in the Output window.

IntelliSense and code completion

Name Keyboard shortcut Description
List Members Ctrl+J
Ctrl+K, L
Displays a list of members.
Complete Word Ctrl+SPACE
Ctrl+K, W
Alt+Right Arrow
Completes the current word.
Parameter Info Ctrl+Shift+Space
Ctrl+K, P
Displays information about function or procedure parameters.
Insert Template Ctrl+K, X Inserts a predefined code template.
Quick Info Ctrl+K, I Shows tooltip with relevant information for the identifier at the cursor.

Commenting and formatting

Name Keyboard shortcut Description
Comment Selection Ctrl+E, C Comments out the selected lines.
Uncomment Selection Ctrl+E, U Uncomments the selected lines.

Code folding

Name Keyboard shortcut Description
Toggle Outlining Expansion Ctrl+M, M Expands or collapses the currently selected region.
Toggle All Outlining Ctrl+M, L Expands or collapses all outlining regions.
Stop Outlining Ctrl+M, P Removes all outlining in the document.

Zooming in and out

Name Keyboard shortcut Description
  Ctrl+Plus key Increases the font size in the editor.
  Ctrl+Minus key Decreases the font size in the editor.
  Ctrl+0 Resets the font size to the default value.

These shortcuts are default shortcuts. All shortcuts can be customized.