dbForge Studio for SQL Server can help you to format your SQL statements, paying attention to case, line breaks, whitespaces, indenting, wrapping, etc. Statements with errors are skipped and are not formatted.
THe guide describes the following topics:
Before you format your code, you might want to configure formatting options and customize case formatting profiles. To tune formatting options:
To format the whole code of a document do one of the following:
To format current statement:, do one of the following:
To format a certain code fragment:
The 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 use dbForge Studio for SQL Server to insert missing semicolons after each statement in a query.
To insert semicolons, right-click the statement body, point to Refactoring, and then click the Insert Semicolons option. Alternatively, hold Ctrl and press B and then C.
Download dbForge Studio for SQL Server and try it absolutely free for 30 days!