Formatting options

SQL Complete can help you beautify your SQL code instantly. To access formatting options, on the SQL Complete menu click Options. In the Options window that opens, navigate to the Formatting tab.

Options for SQL formatting window

As you can see, general formatting options are grouped into three categories.

Formatting

Here you can select how your code will be formatted: immediately on paste, after you add a delimiter to a completed statement, or automatically when typing.

The Right Margin option allows the user to specify the code line length in symbols.

Note

Right Margin is a base point for formatting rules applicable for different statements, for example, Wrap condition when the margin is exceeded and Single line when the margin is not exceeded.

Notifications

In the Notifications group of options, you can select to display syntax errors in the Output window and whether to show or not the syntax error notification window.

Dictionary

In the Dictionary file field, you can specify a path to a dictionary containing a list of names. The dictionary can be edited, the names can be added and deleted. When the formatting option Initial caps each word is enabled the words that are in the dictionary will be capitalized.

The Available prefixes field allows specifying prefixes that won’t be capitalized, when the Initial caps each word option is enabled. Use the semicolon symbol as a delimiter when entering multiple prefixes.

Note

You can enable\disable the Initial caps each word option when configuring the specific profile. How to set up formatting rules for a profile see the section below.

Formatting profiles

Formatting profile comprises a set of rules for how to layout your SQL. In order to configure formatting options or rules to beautify SQL code, do the following:

  1. On the SQL Complete menu, click Options.
  2. In the Options window, go to the Formatting > Profiles tab.
  3. Choose one of the predefined formatting profiles or create a new one.
  4. Click the Open Selected button.
  5. Edit formatting options in the left-hand pane.
  6. Click Save As.
  7. Click OK.

Every formatting profile has a number of rules.

Options window

Options are grouped mainly by the statement. Each group has a set of such options as Line Breaks, Indentation, and Insert Spaces.

Changes in the default state of options and their influence on statement formatting can be viewed on the right-hand pane Formatting preview.

Search for statements or options can be conducted via the option search box.

Option search control

Text options

Text options allow the user to indicate the Tab size and the Indent size in symbols. Here you can also select to Keep tabs and Insert Spaces, as well as specify the Right margin.

Tab size specifies the width of a tab character in whitespaces.

Indent size defines how many whitespaces will be put in the indented line start.

The indentation is performed with tabs or spaces depending on which option is selected - Keep tabs or Insert Spaces.

To hide/show the Text options pane, click the gear-wheel icon in the menu of the Edit Formatting Profile window.

Want to Find out More?

Overview

Overview

Take a quick tour to learn all about the key benefits delivered by dbForge SQL Complete for SQL Server.
All Features

All features

Get acquainted with the rich features and capabilities of the SQL Complete in less than 5 minutes.
Request a demo

Request a demo

If you consider employing the SQL Complete for your business, request a demo to see it in action.
Ready to start using dbForge SQL Complete for SQL Server?