dbForge Studio for SQL Server helps you format SQL statements by managing case, line breaks, whitespace, indentation, wrapping, and more, in accordance with the current formatting style rules. As a result, you can get a SQL code layout that is easily readable for most users.
Note
dbForge Studio can format only complete code blocks. Applying formatting to a code fragment (for example, a part of a query or a single line of code) will result in a syntax error.
You can format code for an entire document or its fragment.
To format code for an entire document, click
on the Text toolbar.
Alternatively, press Ctrl+K, D.
To format a code fragment:
1. Select the code fragment.
2. Right-click the selected code.
3. Select Format > Format Selection.
Alternatively, select the code fragment and press Ctrl+K, F.
The formatting applies according to the settings of the active formatting profile. For more information, see Customize the formatting style with profiles.
For more information on formatting settings, see Formatting options.
When formatting an entire SQL document in the editor, you can exclude specific code fragments from formatting by wrapping them with the noformat and endnoformat tags.
Any of the following formats is acceptable.
-- noformat
<code>
-- endnoformat
-- noformat
<code>
/* endnoformat */
/* noformat */
<code>
/* endnoformat */
/* noformat */
<code>
-- endnoformat
dbForge Studio can detect errors in statements during formatting. If you have a formatting error and attempt to format the code, an error message is displayed.

Warning
Only the valid statements can be formatted. Statements with errors cannot be formatted.
Tip
Select the Don’t show this message again checkbox to prevent the error message from appearing when formatting errors are detected.
You can view the detected errors: