The query editor
The editor is based on Monaco, the editor of Visual Studio Code. Every query lives in its own tab.
Tabs
- + opens a new tab on the database you picked last.
- Every tab belongs to exactly one connection and database. The connection's colour tag appears as a dot on the tab.
- If the connection is missing, the tab shows No connection. Assign connection then takes the first open connection from the sidebar.
- Open tabs survive a restart, unsaved ones included.
Running queries
Execute (F5) or Ctrl+Enter starts the query. If text is selected, only the selection runs. Cancel stops a running query.
Scripts with GO
GO splits a script into batches, exactly like SQL Server Management Studio:
- All batches run one after another on the same connection.
USE,#temptables andSEToptions therefore carry acrossGO. CREATE PROCEDUREorCREATE VIEWmust start their batch; with aGObefore them that works.GO 5runs the preceding batch five times.- If a batch fails, the remaining ones still run. The error message names the line in the whole script, e.g.
[Zeile 42].
IntelliSense
As you type, the editor suggests the tables and columns of the tab's database. Each database has its own list, even when several tabs point at the same server.
Formatting
Shift+Alt+F formats the query: keywords in upper case, line breaks before FROM, WHERE, JOIN and friends, indented conditions. Comments, strings and names in square brackets stay untouched. It works on half-finished SQL too.
Go to definition
Put the cursor on an object name and press F12: the definition of the view, procedure or function opens in a new tab.
Rename / Refactor
Put the cursor on a name and press Shift+F2. The dialog searches every view, procedure and function whose definition contains that name and lists the matches with line numbers.
After entering the new name and choosing the objects, Rename replaces the name in the selected definitions. This dialog does not change the renamed object itself. A table is renamed via the explorer, see Creating and changing objects.
Files
| Action | Shortcut |
|---|---|
| Save | Ctrl+S |
| Open | Ctrl+O |
| Save As | icon on the right of the toolbar |
Save As suggests the folder from the Folder for queries setting. A tab's file path appears as a tooltip on the file name in the toolbar.
Right-click in the editor
The context menu contains AI: Improve, Format SQL, Go to Definition and Rename / Refactor, in addition to the usual entries such as copy and paste.
While you type, the T-SQL linter checks the query and underlines problems.