The query formatting feature adds line breaks and indentation before certain keywords, making SQL that comes from automatic code generators or other sources more readable. Formatting also indents derived tables. If nested derived tables are used, the indentation level will be increased for each nested level.
- Make sure a statement exists in the Query window.
- Optionally, select part of the query. If no text is selected, the entire query will be formatted.
Do one of the following:
- Click .
- Right-click in the Query window, then select Format Query.
- Press Ctrl+Q.
- Select .