The SQL Editor is a text editing interface for writing, editing, and executing SQL queries, scripts, and statements against your databases. It offers code-specific features, such as syntax highlighting, code completion (IntelliSense), formatting, error detection, code snippets and templates, and navigation tools.
You can open the SQL Editor by using Database Explorer, the top menu, the standard toolbar, the Start Page, or a keyboard shortcut.
To open the SQL Editor, right-click a required server connection or a database, then select New SQL.
To open the SQL Editor, do one of the following:
To open the SQL Editor, do one of the following:
Click New SQL.
Click
New File:
To open the SQL Editor, click SQL Development > SQL Editor.
To open the SQL Editor, press Ctrl+N.
The SQL Editor consists of the following components:

The table describes the SQL Editor toolbar options.
| Icon | Name | Description |
|---|---|---|
| Display an Object Member List | Shows a list of valid database objects, such as databases, tables, and columns. To insert a selected item into your code, press Tab, type a space, or type a period.Shortcut: Ctrl+K, Ctrl+L |
|
| Display a Parameter Info | Shows a list of parameters when you start typing a function or stored procedure and open the parenthesis (.Shortcut: Ctrl+Shift+Space |
|
| Display Quick Info | Shows general information about an identifier when you hover over it. Shortcut: Ctrl+K, I |
|
| Display Word Completion | Suggests possible completions for the word you are typing. Shortcut: Ctrl+K, W |
|
| Refresh Suggestions | Updates a list of suggestions to reflect the changes. Shortcut: Ctrl+Shift+R |
|
| Enable/Disable Code Completion for current document | Enables or disables the code completion feature for the active document. | |
| Decrease Line Indent | Moves the selected lines to the left by one level of indentation—for example, by removing a tab or leading spaces. | |
| Increase Line Indent | Moves the selected lines to the right by one level of indentation—for example, by adding a tab or a specific number of spaces. | |
| Comment out the selected lines | Turns the selected lines into comments, making them non-executable. Shortcut: Ctrl+K, C |
|
| Uncomment the selected lines | Removes comment markers from the selected lines, making the code executable. Shortcut: Ctrl+K, U |
|
| Toggle a bookmark on the current line | Adds or removes a bookmark on the selected line. Shortcut: Ctrl+K, K |
|
| Move the caret to the previous bookmark | Moves the cursor to the previous bookmark in the script. Shortcut: Ctrl+K, Ctrl+P |
|
| Move the caret to the next bookmark | Moves the cursor to the next bookmark in the script. Shortcut: Ctrl+K, Ctrl+N |
|
| Clear all bookmarks in the current document | Removes all bookmarks in the active document. Shortcut: Ctrl+K, L |
|
| Format Document | Automatically formats SQL code in the active document. Shortcut: Ctrl+K, D |
|
| Format Current Statement | Applies formatting to the SQL statement at the current cursor location. Shortcut: Ctrl+K, S |
|
| Analyze Code | Scans the SQL script to identify syntax errors, logical issues, and best practice violations before execution. |
To select the text in your code, do one of the following:
Code folding lets you temporarily collapse a block of code so only the header or first line remains visible.
To fold your code, on the left margin of the SQL Editor, click the minus sign.
Code unfolding restores collapsed lines, displaying the full content of the code block.
To unfold your code, on the left margin of the SQL Editor, click the plus sign.
To preview the content of the collapsed clause, hover over it.

You can personalize the appearance of SQL code elements, such as TODO lists or comments.
To change font settings:
1. On the top menu, select Tools > Options.
2. Navigate to Environment > Font and Colors.
3. In the Display items list, choose the item you want to modify.
4. Adjust the Font, Size, Foreground color, and Background color as needed.
5. Click OK to apply the changes.

You can change the case of selected text using menu commands or keyboard shortcuts.
To make the text uppercase, select the text and do one of the following:
To make the text lowercase, select the text and do one of the following:
View White Space mode displays spaces and tab characters.
To view white space:
1. Place the cursor anywhere in the editor.
2. On the top menu, select Edit > Advanced > View White Space.
Alternatively, press Ctrl+R, Ctrl+W.
Word Wrap moves any part of a long line that extends beyond the visible width of the SQL Editor onto the next visual line, so you can view the entire line without scrolling horizontally.
To use word wrap mode, do one of the following:
To show line numbers, do one of the following:
You can temporarily disable a section of SQL code by commenting it out.
To comment out a block:
1. Place the cursor on the line or select the block of code you want to comment.
2. On the top menu, select Edit > Advanced > Toggle Block Comment.
Alternatively, press Ctrl+Shift+/.
To make a previously commented block executable again, do one of the following:
To comment out selected lines of code:
1. Select the line or block of code you want to comment out.
2. Do one of the following:
On the top menu, select Edit > Advanced > Comment Selection.
On the toolbar, click
Comment out the selected lines.
Press Ctrl+K, C.
To remove comment markers from selected lines of code:
1. Select the line or block of code you want to uncomment.
2. Do one of the following:
On the top menu, select Edit > Advanced > Uncomment Selection.
On the toolbar, click
Uncomment the selected lines.
Press Ctrl+K, U.
To move selected lines to the right by one indentation level:
1. Select the lines you want to indent.
2. On the top menu, select Edit > Advanced > Increase Line Indent.
Alternatively, on the toolbar, click
Increase Line Indent.
To move selected lines to the left by one indentation level:
1. Select the lines you want to unindent.
2. On the top menu, select Edit > Advanced > Decrease Line Indent.
Alternatively, on the toolbar, click
Decrease Line Indent.
To insert a code snippet into your script:
1. Place the cursor where you want to insert a snippet.
2. On the top menu, select Edit > Code Completion > Insert Snippet.
3. In the suggestion list, select the snippet you want to insert.
The snippet template appears where you can modify it as needed.
You can add a bookmark to any line in your SQL document to help you quickly navigate the code.
To add a bookmark, do one of the following:
On the top menu, select Edit > Bookmarks > Toggle Bookmark.
On the toolbar, click
Toggle a bookmark on the current line.
Press Ctrl+K, K.
Note
Bookmarks are added to the line where the cursor is positioned.

To move your cursor to the previous bookmark, do one of the following:
On the top menu, select Edit > Bookmarks > Previous Bookmark.
On the toolbar, click
Move the caret to the previous bookmark.
Press Ctrl+K, Ctrl+P.
To move your cursor to the next bookmark, do one of the following:
On the top menu, select Edit > Bookmarks > Next Bookmark.
On the toolbar, click
Move the caret to the next bookmark.
Press Ctrl+K, Ctrl+N.
To remove all bookmarks in the active document, do one of the following:
On the top menu, select Edit > Bookmarks > Clear Bookmarks.
On the toolbar, click
Clear all bookmarks in the current document.
Press Ctrl+K, L.
Use code outlining to collapse or expand logical blocks in your SQL scripts, such as BEGIN...END sections, stored procedures, functions, or multi-line queries. This feature helps you focus on the structure while hiding code details when needed.
To collapse or expand all blocks, on the top menu, select Edit > Outlining > Toggle All Outlining, or press Ctrl+M, M.
To collapse or expand a specific block of code, select Edit > Outlining > Toggle Outline Expansion, or press Ctrl+M, L.
To stop outlining and remove all collapsible regions, select Edit > Outlining > Stop Outlining, or press Ctrl+M, P.
To enable automatic detection of collapsible regions, select Edit > Outlining > Start Automatic Outlining.
To configure the SQL Editor settings, do one of the following:

The status bar displays information regarding the current connection, including a connection status, server, username, and selected database.

When you execute a query, the query execution status is shown instead of the connection status. The query execution time also appears in the status bar.
