Published: 2026-10-14

Keyboard Shortcuts to Run a Query in SSMS, Azure Data Studio, DataGrip, DBeaver and VS Code

In SQL Server Management Studio the key that executes a query is F5. Azure Data Studio also uses F5, plus Ctrl+F5 for the statement at the cursor. DataGrip and DBeaver use Ctrl+Enter (Cmd+Enter on a Mac), and VS Code with the MSSQL extension uses Ctrl+Shift+E (Cmd+Shift+E). The tables below list the Windows and macOS keys for running, cancelling, execution plans, the results pane, formatting and commenting in each tool, checked against each vendor’s documentation as of October 2026. The last part shows how often people actually press a key to run a query, from 60 days of Jam SQL Studio usage data.

The short answer

Tool (version checked)WindowsmacOSWhat the key runs
SSMS (22.11.0)F5No macOS versionThe selection, or the whole query window
Azure Data Studio (1.52.0, final release)F5; Ctrl+F5F5; Cmd+F5F5: the selection or the whole editor. Ctrl/Cmd+F5: the statement at the cursor
DataGrip (2026.2)Ctrl+EnterCmd+EnterThe selection, or the statement at the caret (with several statements it asks first)
DBeaver (26.2.2)Ctrl+Enter; Alt+XCmd+Enter; Option+XCtrl/Cmd+Enter: the statement under the cursor or the selection. Alt/Option+X: the whole script
VS Code + MSSQL extension (1.46.0)Ctrl+Shift+ECmd+Shift+EThe selection, or the whole file
Jam SQL Studio (1.5.5)F5, Ctrl+Enter, Shift+Enter; Shift+F5F5, Cmd+Enter, Shift+Enter; Shift+F5The selection, or the statement at the cursor. Shift+F5: the whole editor

On a Mac keyboard, F5 usually needs the Fn (Globe) key held down, unless Use F1, F2, etc. keys as standard function keys is turned on in System Settings → Keyboard (Apple).

SSMS 22 shortcuts (Windows only)

SQL Server Management Studio is a Windows application; there is no macOS or Linux version (system requirements). The keys below are from Microsoft’s SSMS keyboard shortcuts page and apply to SSMS 22, whose current release is 22.11.0 (October 13, 2026).

ActionWindows
Run the whole query windowF5 with nothing selected
Run the selectionF5
Run the statement at the cursorNo shortcut: select the statement, then F5
Check syntax without running (Parse)Ctrl+F5
Cancel a running queryAlt+Break (the Pause/Break key)
Estimated execution planCtrl+L
Actual execution planCtrl+M (Include Actual Execution Plan), then F5
Show or hide the results paneCtrl+R; F6 moves focus between the query and the results
Format SQLCtrl+K, Ctrl+Q (SSMS 22.7 and later)
Comment / uncomment linesCtrl+K, Ctrl+C / Ctrl+K, Ctrl+U
Change shortcutsTools → Options → Environment → Keyboard

Format SQL is from Microsoft’s Format T-SQL page; the SQL formatter became generally available in SSMS 22.10.2 (release notes). Older third-party guides also list Ctrl+E and Alt+X as Execute. Microsoft’s current shortcut page lists only F5, and we did not test the other two in SSMS 22. In the query editor, Ctrl+Enter inserts a blank line above the current one and Shift+Enter inserts a new line; neither runs anything.

Azure Data Studio shortcuts (retired, final release 1.52.0)

Microsoft retired Azure Data Studio on February 28, 2026, and it no longer receives updates or security fixes. The last general release was 1.52.0 (June 18, 2025). The query keys below are from that release’s source (keyboardQueryActions.ts at tag 1.52.0) and the archived keyboard shortcuts page. Azure Data Studio is built on VS Code, so formatting and commenting use VS Code’s keys.

ActionWindows / LinuxmacOS
Run the whole editorF5 with nothing selectedF5 with nothing selected
Run the selectionF5F5
Run the statement at the cursorCtrl+F5Cmd+F5
ParseShift+Alt+PShift+Option+P
Cancel a running queryAlt+Pause/BreakNo usable key (no Pause key on Mac keyboards); use Cancel in the toolbar
Estimated execution planCtrl+LCmd+L
Actual execution plan on/offCtrl+MCmd+M
Show or hide the resultsCtrl+Shift+RControl+Shift+R
Format SQL (Format Document)Shift+Alt+F (VS Code key)Shift+Option+F (VS Code key)
Comment lineCtrl+/ (VS Code key)Cmd+/ (VS Code key)
Change shortcutsFile → Preferences → Keyboard Shortcuts, or Ctrl+K Ctrl+SAzure Data Studio → Preferences → Keyboard Shortcuts, or Cmd+K Cmd+S

If you are moving off Azure Data Studio, the migration guide covers connections, extensions and what replaces each feature.

DataGrip 2026.2 shortcuts

From JetBrains’ Run queries, keyboard shortcuts, Reformat code and Query execution plan pages and the default Windows and macOS keymap references, for DataGrip 2026.2.

ActionWindows / LinuxmacOS
Run the whole scriptNo single key: pick the script in the Ctrl+Enter list, or select all and press Ctrl+EnterSame, with Cmd+Enter
Run the selectionCtrl+EnterCmd+Enter
Run the statement at the caretCtrl+EnterCmd+Enter
Run a SQL file from the Files tool windowCtrl+Shift+F10Control+Shift+R
Cancel a running queryCtrl+F2Cmd+F2
Estimated execution plan (Explain Plan)No default key; the Explain Plan button in the editor toolbar or the context menu
Actual execution plan (Explain Analyse)No default key; same menu as Explain Plan
Show or hide the resultsAlt+8 opens the Services tool window; Shift+Esc hides itCmd+8; Shift+Esc
Format SQL (Reformat Code)Ctrl+Alt+LCmd+Option+L
Comment line / blockCtrl+/ / Ctrl+Shift+/Cmd+/ / Cmd+Option+/
Change shortcutsSettings (Ctrl+Alt+S) → KeymapSettings (Cmd+,) → Keymap

When the file holds more than one statement, Ctrl+Enter first shows a list of what it can run: the statement under the caret, and an entry for the whole script. The list’s Customize option can make Ctrl+Enter run the statement under the caret without asking. Three DataGrip keys mean something else in other tools: Shift+Enter starts a new line, Ctrl+E opens Recent Files and Ctrl+R opens Replace. On many Linux desktops Ctrl+Alt+L locks the screen before DataGrip sees it.

DBeaver 26.2 shortcuts

From DBeaver’s Shortcuts and SQL Execution pages, for DBeaver 26.2.2 (October 4, 2026). DBeaver mixes modifier keys on macOS: running uses Cmd, but formatting, the results panel and the execution plan use Control.

ActionWindows / LinuxmacOS
Run the whole scriptAlt+XOption+X
Run the selectionCtrl+Enter (as one statement) or Alt+X (as a script)Cmd+Enter or Option+X
Run the statement under the cursorCtrl+EnterCmd+Enter
Run it into a new results tabCtrl+\Control+\
Cancel a running queryNo default key; the Cancel query command exists and can be given one under Keys
Execution plan (Explain)Ctrl+Shift+EControl+Shift+E
Actual execution planNo separate key
Show or hide the results panelCtrl+T; Ctrl+Shift+T maximizes itControl+T
Format SQLCtrl+Shift+FControl+Shift+F
Comment lineCtrl+/Control+/
Change shortcutsWindow → Preferences → User Interface → KeysPreferences → User Interface → Keys

The cancel command is org.jkiss.dbeaver.ui.editors.sql.cancel.query; it has no key binding in DBeaver’s plugin.xml at tag 26.2.2. F5 in DBeaver refreshes the selected items rather than running SQL.

VS Code MSSQL extension shortcuts

From Microsoft’s MSSQL extension keyboard shortcuts page, for MSSQL extension 1.46.0 (September 28, 2026), plus VS Code’s own editing keys. Execute Query is the only query command on that page with a default key.

ActionWindows / LinuxmacOS
Run the whole file (MS SQL: Execute Query)Ctrl+Shift+E with nothing selectedCmd+Shift+E with nothing selected
Run the selectionCtrl+Shift+ECmd+Shift+E
Run the statement at the cursorNo default key (command: Execute Selection or Current Statement)
Cancel a running queryNo default key
Estimated / actual execution planNo default keys
Show or hide the resultsNo default key (command: Toggle Query Result Panel)
Format SQL (Format Document)Shift+Alt+F on Windows, Ctrl+Shift+I on LinuxShift+Option+F
Comment lineCtrl+/Cmd+/
Change shortcutsCtrl+K Ctrl+SCmd+K Cmd+S

Ctrl+Shift+E runs the query only while a SQL editor has focus; anywhere else in VS Code it shows the Explorer. The same Microsoft page documents the MSSQL Database Management Keymap extension (0.1.2), which adds SSMS-style keys:

Action (with the Keymap extension)Windows / LinuxmacOS
Run the queryF5F5
Run the current statementCtrl+F5Cmd+F5
CancelAlt+Pause/BreakOption+Pause/Break (needs a keyboard with that key)
Estimated planCtrl+LCmd+L
Actual plan on/offCtrl+MCmd+M
Show the results paneMicrosoft’s page says Win+Shift+R / Cmd+Shift+R; the extension’s manifest binds Ctrl+Shift+R. Check Keyboard Shortcuts after installing.

Shortcuts on a Mac

  • SSMS has no Mac version. Of the tools above, DataGrip, DBeaver and VS Code with the MSSQL extension run on macOS, and so does Azure Data Studio, which no longer gets fixes. For more options see SSMS alternatives for Mac.
  • Function keys need Fn. F5, Cmd+F5 and Cmd+F2 work, but on most Mac keyboards the top row sends brightness and volume unless you hold Fn or change the keyboard setting.
  • There is no Pause/Break key. The SSMS-style cancel key (Alt+Break) used by Azure Data Studio and the MSSQL keymap has nothing to press on a Mac keyboard; use the toolbar’s Cancel or Stop button, or bind cancel to another key.
  • Cmd or Control depends on the tool. DataGrip and VS Code use Cmd almost everywhere. DBeaver uses Cmd+Enter to run but Control for format, explain, the results panel and comments. Azure Data Studio’s results toggle was Control+Shift+R.

Same key, different action

These keys exist in more than one tool with a different meaning, which matters when you move between tools:

Key (Windows)What it does
F5Runs the query in SSMS, Azure Data Studio and Jam SQL Studio. Refreshes the selected items in DBeaver. Starts debugging in VS Code, unless the MSSQL keymap is installed.
Ctrl+F5Parses without running in SSMS. Runs the statement at the cursor in Azure Data Studio and with the MSSQL keymap.
Ctrl+EnterRuns a statement in DataGrip, DBeaver and Jam SQL Studio. Inserts a blank line above in SSMS and a line below in VS Code.
Shift+EnterRuns a statement in Jam SQL Studio. Inserts a new line in SSMS and DataGrip.
Ctrl+Shift+ERuns the query in a VS Code SQL editor and shows the Explorer elsewhere in VS Code. Explains the execution plan in DBeaver.
Ctrl+LEstimated plan in SSMS and Azure Data Studio. Selects the current line in VS Code.
Ctrl+RShows or hides the results pane in SSMS. Opens Replace in DataGrip.
Ctrl+EOpens Recent Files in DataGrip. Older SSMS guides list it as Execute.

Jam SQL Studio shortcuts and schemes

Jam SQL Studio runs on Windows, macOS and Linux. Its default keys in version 1.5.5, from the keyboard shortcuts reference:

ActionWindows / LinuxmacOS
Run the whole editorShift+F5 (ignores the selection)Shift+F5
Run the selectionF5, Ctrl+Enter or Shift+EnterF5, Cmd+Enter or Shift+Enter
Run the statement at the cursorCtrl+Enter or Shift+Enter; also F5 when the editor holds several statementsCmd+Enter or Shift+Enter; also F5
Cancel a running queryNo default key; the Stop button. Cancel query can be given a key in Settings, and the SSMS and DataGrip schemes set one
Estimated / actual execution planNo shortcut; the toolbar’s Plan menu (Execute with Actual Plan, Estimated Plan)
Show or hide the results paneCtrl+JCmd+J
Format SQLShift+Alt+FShift+Option+F
Comment lineCtrl+/ (fixed)Cmd+/ (fixed)
Change shortcutsSettings → Keyboard Shortcuts

Settings → Keyboard Shortcuts also has a Scheme picker with SSMS / Azure Data Studio, JetBrains DataGrip, DBeaver and VS Code mssql extension. A scheme changes only the keys for executing, cancelling, formatting and the results pane; every other command keeps its Jam SQL key, and shortcuts you recorded yourself are kept. The per-scheme key table is in the shortcut schemes section of the docs. Where the schemes differ from the real tools:

  • F5 is narrower than in SSMS. With nothing selected in an editor that holds several statements, Jam SQL Studio’s F5 runs the statement at the cursor; SSMS and Azure Data Studio run the whole window. Use Shift+F5 to run everything. This applies in every scheme.
  • Cmd/Ctrl+Enter and Shift+Enter run the current statement in every scheme, including SSMS, where those keys insert lines. If you want them to type new lines, remove them in Settings: click the shortcut and press Backspace.
  • Not copied: the execution-plan keys (Ctrl+L, Ctrl+M, DBeaver’s Ctrl+Shift+E), the SSMS Ctrl+K chords for format and comment, Ctrl+F5 (it means Parse in SSMS and run-current-statement in Azure Data Studio), Azure Data Studio’s Ctrl+Shift+R, Ctrl+E / Alt+X from older SSMS guides, and DBeaver’s new-tab Ctrl+\. Jam SQL Studio has no keyboard command for execution plans.
  • SSMS / Azure Data Studio scheme: cancel is Alt+Pause and the results pane Ctrl+R on Windows and Linux. On macOS there is no Pause key, so cancel stays unbound, and the results pane stays Cmd+J because Microsoft documents no Mac key for it.
  • DataGrip scheme: cancel Ctrl+F2 / Cmd+F2 and format Ctrl+Alt+L / Cmd+Option+L. Cmd/Ctrl+Enter runs the statement at the cursor straight away; there is no list to pick from as in DataGrip.
  • DBeaver scheme: Alt+X runs the whole editor, Ctrl+T (also Control on macOS) toggles the results pane and Ctrl+Shift+F formats. Cancel stays unbound, as in DBeaver.
  • VS Code mssql scheme: Cmd/Ctrl+Shift+E replaces F5. It works whenever a Query Editor tab is active, also while focus is in the Object Explorer or the results grid, and in a multi-statement editor it runs the statement at the cursor, not the whole file as the extension does. Outside Query Editor tabs the key keeps expanding the Explorer.

To change a single key, open Settings → Keyboard Shortcuts, click the shortcut and press the new keys; Customising shortcuts covers conflicts, second shortcuts and resets.

How often people press a key to run a query

Jam SQL Studio records how each query run was started, with no SQL text. Between August 15 and October 13, 2026, people started 67,597 query runs from 715 installations. This is how they started them:

How the run was startedRunsShare
Toolbar Execute button (no selection)24,95636.9%
Button on a selection (toolbar Execute in Selection mode, the floating Run bar or the gutter)18,34727.1%
Button on the statement at the cursor (Run bar or gutter)8,84213.1%
Keyboard, on a selection6,2049.2%
Keyboard, on the statement at the cursor5,1287.6%
Keyboard, whole editor (Shift+F5, or F5 on a one-statement editor)4,0115.9%
Other buttons (Execute with plan, Visual Query Editor, Peek)1090.2%
All keyboard15,34322.7%

Three out of four runs started with a click. 229 of the 715 installations (32.0%) used a run shortcut at least once in the 60 days. Keyboard use is also concentrated: among the 442 installations with at least 10 runs, 260 (58.8%) never pressed a run key, 119 (26.9%) used one for less than half of their runs, and 63 (14.3%) for half or more. The ten installations with the most keyboard runs account for 52.5% of all of them.

By operating system and engine

GroupRunsStarted by keyboardInstallationsUsed a run key
macOS40,40217.2%368100
Windows22,69028.5%259103
Linux4,50542.7%8826
SQL Server47,39225.0%375121
MySQL / MariaDB14,02915.2%16055
PostgreSQL3,52826.1%12434
Oracle2,03017.6%7521
SQLite45112.9%355

Mac installations ran the most queries and pressed a key the least. Until version 1.5.1 the only run keys were F5 and Shift+F5, which need Fn on most Mac keyboards; the next section shows what changed when Cmd+Enter arrived. Linux installations started 42.7% of their runs from the keyboard, but there are only 88 of them.

Before and after Cmd/Ctrl+Enter

Version 1.5.1 added Cmd/Ctrl+Enter and Shift+Enter for the statement at the cursor, editable shortcuts and the schemes; the first runs from it arrived on September 24, 2026. Splitting the same 60 days by the app version that sent each run:

Runs from1.5.0 and earlier1.5.1 and later
All installations: share of runs by keyboard17.1% of 44,66933.6% of 22,928
Installations that used a run key114 of 558 (20.4%)154 of 382 (40.3%)
macOS: share of runs by keyboard9.8% (281 installations)31.8% (214)
Windows24.8% (211)35.4% (129)
Linux43.5% (66)40.7% (39)
Same 125 installations, at least 20 runs on each side20.4%34.8%

The same-installation row is the most reliable comparison: of those 125 installations, 45 started using run keys after updating and 2 stopped; 28 used them before and after, and 50 never did. The number of installations that ran the statement at the cursor from the keyboard went from 53 to 110, and 93 of the 110 had not done so before. By engine the change was not uniform: SQL Server went from 19.5% to 36.9% and MySQL from 5.4% to 31.2%, while PostgreSQL went from 31.1% to 18.9% on 91 and 52 installations, a group small enough that a few heavy users move it.

The schemes have not been used yet. In the 20 days after 1.5.1, 639 installations on 1.5.1 or later sent usage events and 107 of them opened Settings, but none sent a scheme change or a changed shortcut.

Methodology

  • Shortcut tables. Each tool’s keys come from the vendor documentation linked in its section, read on October 14, 2026, and for Azure Data Studio and DBeaver also from the source code at the release tag. Where a vendor page and the code disagree, the table says so. We did not press every key in every tool.
  • Source and window. Jam SQL Studio’s anonymous in-app usage events, August 15 to October 13, 2026 (60 full UTC days). Each query run sends one event with the engine, the operating system, the app version and how the run was started.
  • What is not collected. No SQL text, no table, column, schema or database names, no hostnames. Usage analytics can be turned off in Settings → Privacy, and installations that did so are not in these numbers. The privacy policy describes the telemetry.
  • Installations, not people. Each installation sends an anonymous identifier derived from a hashed device fingerprint. One person on two machines counts twice; two people sharing a machine count once.
  • Runs started by a person. The window holds 73,358 runs from 777 installations. Excluded: 5,674 runs that started on their own (a tab opened from an object action such as Select Top runs its query, saving grid edits, and Visual Query Editor previews), 86 runs requested by AI agents over MCP, and 1 run without a source. The “statement at the cursor” button row also includes the Query a table starter and the compact Visual Query Editor, which use the same run path.
  • Before and after. Runs are split by the app version on each event, not by date; the first 1.5.1 event arrived on September 24. The 1.5.1 side covers 20 days, the earlier side covers installations that had not updated yet across all 60. This is not a controlled experiment: people who update early may use the keyboard more. The same-installation comparison removes part of that bias.
  • Engines. MySQL and MariaDB share one engine in the app. Azure Data Explorer (167 runs from 6 installations) is too small to show. SQLite (35 installations) is shown but too small to read much into.
  • Who is in the sample. These are Jam SQL Studio users, whose editor shows Run buttons next to a selection and next to each statement. The shares describe this app, not SSMS or DataGrip users in general.

Quick Answers

Q: What is the keyboard shortcut to execute a query in SQL Server Management Studio?

A: F5. In SSMS 22 it runs the selected text, or the whole query window when nothing is selected. Alt+Break (the Pause/Break key) cancels a running query, Ctrl+L shows the estimated execution plan, Ctrl+M turns on the actual plan for the next run, and Ctrl+R shows or hides the results pane. SSMS has no key that runs only the statement at the cursor: select the statement and press F5.

Q: Is there a Mac version of SSMS, and what are the shortcuts on a Mac?

A: No. SSMS runs only on Windows. On a Mac, the VS Code MSSQL extension runs a query with Cmd+Shift+E, DataGrip and DBeaver run the statement at the cursor with Cmd+Enter, and Azure Data Studio used F5 and Cmd+F5 until it was retired on February 28, 2026. Function keys such as F5 need the Fn key on most Mac keyboards, and Mac keyboards have no Pause/Break key, so the SSMS cancel key has no Mac equivalent.

Q: What is the shortcut to run a query in DataGrip?

A: Ctrl+Enter on Windows and Linux, Cmd+Enter on macOS. It runs the selection, or the statement at the caret. When the file has several statements, DataGrip first lists what it can run, including the whole script, and the list's Customize option makes it run the statement under the caret straight away. Ctrl+F2 (Cmd+F2) stops the query and Ctrl+Alt+L (Cmd+Option+L) formats it. Explain Plan has no default key.

Q: What is the DBeaver shortcut to execute a statement?

A: Ctrl+Enter (Cmd+Enter on macOS) runs the statement under the cursor or the selected text. Alt+X (Option+X) runs the whole script. Ctrl+Shift+E explains the execution plan, Ctrl+T shows or hides the results panel and Ctrl+Shift+F formats the SQL; on macOS those three use Control, not Cmd. DBeaver has no default key to cancel a query.

Q: What is the shortcut to execute a query in VS Code with the MSSQL extension?

A: Ctrl+Shift+E on Windows and Linux, Cmd+Shift+E on macOS, while a SQL editor has focus. It runs the selection, or the whole file when nothing is selected. Cancel, the execution plans, the results pane and running only the current statement have no default keys. The MSSQL Database Management Keymap extension adds SSMS-style keys: F5 to run, Ctrl+F5 (Cmd+F5) for the current statement, Ctrl+L (Cmd+L) and Ctrl+M (Cmd+M) for the plans, and Alt+Pause/Break to cancel.

Q: What is the Azure Data Studio shortcut to run a query?

A: F5 runs the selection or the whole editor, and Ctrl+F5 (Cmd+F5 on macOS) runs only the statement at the cursor. Ctrl+L (Cmd+L) shows the estimated plan, Ctrl+M (Cmd+M) turns the actual plan on or off, and Ctrl+Shift+R shows or hides the results. Azure Data Studio was retired on February 28, 2026, and its last release, 1.52.0, no longer gets updates or security fixes.

Q: How many people actually use a keyboard shortcut to run queries?

A: In Jam SQL Studio's anonymous usage data for August 15 to October 13, 2026, 22.7% of the 67,597 query runs started by a person came from a keyboard shortcut, and 32% of the 715 installations used a run shortcut at least once. Among installations on version 1.5.1 or later, which added Cmd/Ctrl+Enter and Shift+Enter, the keyboard share was 33.6% of runs, against 17.1% on earlier versions. Most runs still start from the toolbar Execute button or the editor's Run controls.

Summary

SSMS and Azure Data Studio run with F5; DataGrip and DBeaver with Ctrl+Enter or Cmd+Enter; VS Code’s MSSQL extension with Ctrl+Shift+E or Cmd+Shift+E. SSMS and the MSSQL extension have no default key for the statement at the cursor. SSMS and Azure Data Studio have keys for both execution plans, DBeaver has one for Explain, and DataGrip and the MSSQL extension have none. DBeaver and the MSSQL extension have no default cancel key. On a Mac, expect to hold Fn for function keys and to have no Pause/Break key. In Jam SQL Studio’s data, a little under one run in four started from the keyboard, and one in three on the versions with a key for the statement at the cursor.

Use SSMS, DataGrip or DBeaver Keys in Jam SQL Studio

Jam SQL Studio has shortcut schemes for SSMS / Azure Data Studio, DataGrip, DBeaver and the VS Code mssql extension, on Windows, macOS and Linux. Free for personal use.

Related