Formatting Options
Click Tools | Formatting
Options to open the dialog box displayed below.
The Formatting Options dialog
box allows you to customize available formatting options, to preview the
code before/after its formatting, to import the previously saved option
sets and to export (save) pre-defined ones.


- Use the Preview
pane to see how your changes affect the code.
- To see how formatting changes affect your script, select Current Query from the Preview
drop-down menu. It will show how the script will be formatted after
the formatting is applied.

- Click Restore Defaults
to restore the settings when the add-in was initially installed.
- Click Import to select
and load a saved formatting options file.

- Click Export to save your
formatting options to a file.

General
Capitalization
- Format keywords: Select
this check box to format keywords to upper, lower or proper case.
- Format types: Select this
check box to format types to upper, lower or proper case.
Parenthesis
- Add space around parenthesis content:
Select this check box to add single space both after the opening parenthesis
and before the closing the parenthesis.
- Place content of parenthesis on
new line: Select this check box to insert a line break before
the content of parenthesis.
- Place closing parenthesis on new
line: Select this check box to insert a line break before the
closing parenthesis.
Lines
- Format lines: Select this
check box to activate the options for formatting lines.
- Wrap lines greater than X characters:
Select this check box to insert a line break before the first word
that goes beyond X characters.
- Indent lines by X characters:
Select this check box to indent lines by X characters.
- Indent based on keyword size:
Select this check box to indent lines based on the preceding keyword.
If this checkbox is cleared, all indent options found in other pages
will be disabled.
Lists

Comma spacing
- Add space before commas:
Select this check box to insert a single space before commas.
- Add space after commas:
Select this check box to insert a single space after commas.
Format Multi-Line Listing
- Format-Multi Line Listing:
Select this check box to activate formatting of multi-line lists.
Item Placement
- Place initial item on new line:
Select this check box to insert a line break before the first item
of a list.
- Place subsequent items on new
lines: Select this check box to insert a line break before
the second and subsequent items of a list.
Comma Location
- Place comma before list items:
Click this option to place a comma on the same line immediately before
the following item.
- Do not indent commas: Select
this check box to prevent adding of indentation, while leaving the
indentation of list items unchanged.
- Place comma after list items:
Click this option to place comma on the same line immediately after
the preceding item.
Operators

Arithmetic operators
- Add spaces around operators:
Select this check box to insert a single space before and after arithmetic
operators.
Alignment
- Show operation on multiple lines:
Select this check box to place each operand in an arithmetic operation
on a separate line.
- Place operator before operand:
Click this option to place arithmetic operators before and on the
same line as the following operand.
- Place operator after operand:
Click this option to place arithmetic operators after and on the same
line as the preceding operand.
- Indent operators: Select
this check box to add indentation to arithmetic operations.
Comparison operators
- Add spaces around operators: Select this check box to insert a
single space before and after comparison operators.
Alignment
- Show operation on multiple lines: Select this check box to place
each operand in a comparison operation on a separate line.
- Place operator before operand: Select this check box to place comparison
operators on the same line immediately before the following operand.
- Place operator after operand: Click this option to place arithmetic
operators after and on the same line as the preceding operand.
- Indent operations: Select this check box to add indentation to
comparison operations.
DDL

Parenthesis in Definitions
- Place opening parenthesis on new
line: Select this check box to insert a line break immediately
before the opening parenthesis in definitions.
- Place closing parenthesis on new
line: Select this check box to insert a line break immediately
before the closing parenthesis in definitions.
Multiline Definitions
- Place first defined item on new
line: Select this check box to insert a line break before the
first defined item in a definition.
Note:
If Place first defined item on new line
is not checked all columns
in SELECT, UPDATE... etc, statements are formatted as a single-line.
When this check box is selected, all columns are formatted as multi-line.
Different comma formatting is applied from the Lists tab.
- Indent definitions: Select
this check box to indent definitions that occur on multiple lines.
Keywords

Queries
- Place subqueries on a new line:
Select this check box to insert a line break before each successive
subquery.
- Only queries more than X characters:
Select this check box to limit the preceding option to queries longer
than X characters.
Joins
- Place JOIN on a new line:
Select this check box to insert a line break before the JOIN keyword.
- Align JOIN with FROM: Select
this check box to indent the JOIN keyword in joins to the same horizontal
location as the preceding FROM keyword.
- Place ON on a new line:
Select this check box to insert a line break before the ON keyword
in joins.
- Align ON with FROM: Select
this check box to indent the on keyword in joins to the same horizontal
location as the preceding FROM keyword.
Optionals
- Always use BEGIN-END in IF statements:
Select this check box to enforce the use of BEGIN and END in IF statements.
- Always use BEGIN-END in Procedures:
Select this check box to enforce the use of BEGIN and AND in Procedures.
Copyright © 2010 ApexSQL LLC. All Rights Reserved.