ApexSQL Refactor 2016 R1 – New features

In the new version of ApexSQL Refactor, 2016 R1 we added ten new features

SQL Server 2016 CTP3 support

ApexSQL Refactor 2016 R1 fully supports SQL Server 2016 CTP3 along with SQL Server Management Studio 2016.

Batch/bulk formatting of multiple SQL objects

In the new release, batch formatting of SQL objects has been added. This allows the formatting of all script based objects e.g. stored procedures, in a database, quickly and easily. The user will need to select a database, objects and formatting profile:

Additionally it’s possible to compare a SQL object’s script as it exists and what it will look like after it is formatted:

Obfuscation

This feature is designed to make SQL code less readable, for adding some level of protection to the database of commercial software for example. Wrapping can be set to either to fixed length, random length or a single line. Keyword case can be randomized e.g. sEleCt and comments can be removed:

Redesigned list options

Lists are now formatted in a more consistent way. Some options have been added and others have been changed. New list options are: Tables, Columns, Values, Where in values, Assignments, Variables and Parameters. All list options contain options for moving to a new line and indentation of the list itself and its elements. Some of the list options include parenthesis options, depending on list type:

Improvement of parenthesis options

All parenthesis type options now contain two additional options:

  1. Don’t format if parenthesis are not nested
  2. Don’t format if there is no new line in between

The general options for Add space inside/outside parenthesis are moved to the specific parenthesis type’s options.

Additionally, the Nested selects parenthesis options now have options for controlling the code within parenthesis:

Improvement of granular parenthesis options

Before ApexSQL Refactors 2014 R6 there were only global parenthesis options. In ApexSQL Refactor 2014 R6 we introduced granular parenthesis options. We have added additional parenthesis type options: Columns, Arithmetic expressions, Comparison expressions and Logical expressions. In ApexSQL Refactor 2016 R1 we expanded the list with Values, Where in values, Assignments, Parameters and Nested selects. In this way, we have covered all SQL parenthesis types with granular options.

Smart indent

With the Smart indent option on, all identifiers in data statements are vertically aligned

Improved place On a new line

Formatting On statement options are improved. Along with alignment with Join keyword it’s now possible to align On statements with the beginning of the previous keyword and with the first table. Additionally, setting its relative indentation to all of the three options is made possible:

This feature has also been applied to formatting Nested join operations

Keep empty lines before and after the script

It’s now possible to have empty lines before the beginning and on the end of formatted SQL scripts

Indent condition body statement

It’s now possible to control the indention of the conditional statement

December 14, 2015