What’s new in ApexSQL Diff 2016 R2

In the new version of ApexSQL Diff 2016 R2, many new features and enhancements have been added.

SQL Server on Amazon RDS support

ApexSQL Diff 2016 R2 fully supports SQL Server on Amazon RDS, for database schema comparison and synchronization.

SQL Server Management Studio 2016 integration support

In previous release, SQL Server 2016 was fully supported and now SQL Server Management Studio 2016 add-in integration is supported as well. All five data source types can be selected to initiate the comparison process from SQL Server Management Studio 2016:

Save project as batch file

This new feature is added as a part of the Synchronization wizard and it allows creating of batch files with all previous options set. For example, in the last step of the Synchronization wizard – Summary and warnings, click on the Save project as batch file button in the bottom-left corner of the window:

Once clicked, the Save project as batch file window will open and the batch script will contain all CLI switches that represent all options that were previously set in the GUI project:

When there is a need to perform the same synchronization process or to create comparison reports multiple times, this feature can come in handy, as once it’s created, it can be double-clicked to execute the process or it can be scheduled.

For more information about this feature, check out the article on this link.

Help to HTML switch

The new Help to HTML CLI switch /help_to_html [ /hth ], creates the CLI help file in the HTML format. This new switch is located under the Additional options in the CLI help, when the following command is executed:

ApexSQLDiff.com /?

The full path to the CLI help file, along with a .html extension, needs to be provided to export the CLI help into the HTML format:

ApexSQLDiff.com /help_to_html:C:\Help.html

Once the above command is executed, the HTML CLI help file will be generated with the following message:

The CLI help file was generated successfully and saved to C:\Help.html

Also, it will be automatically opened in a default browser:

To easily manipulate the CLI help file, in the top-right corner of the window, the Expand/Collapse all buttons can be used to expand/collapse option groups. If the Collapse all button is clicked, only the group’s names will be shown:

Switches for each group name can be shown, with a click on a group name:

The new HTML CLI help is better and easier for viewing, locating switches and options, and reading descriptions.

Return error codes switch

One more CLI switch that has been added to the Additional options, is the /return_codes [ /rc ] that outputs all return codes to console, while the application process is executed through the CLI. If this switch is specified along with data sources in the CLI, all return codes will be shown before the comparison process is started:

ApexSQLDiff.com /rc /d1:SourceDB /d2:TargetDB /v

Return codes:
  0 – success
  1 – general error code
  2 – invalid switch
  3 – duplicated switch
  4 – incompatible switches
  5 – missing argument
  6 – missing a dependent switch
  7 – invalid value
  8 – value out of range
  9 – invalid file path
  10 – invalid project file
  11 – unsupported edition
  13 – trial has expired
  14 – connection timeout
  15 – connection failed
  16 – IO error
  17 – operation canceled
  18 – application error
  19 – execution error
  20 – execution timeout
  101 – insufficient permissions
  102 – output file creating failed

Connecting:
    Connecting to [(local)].[SourceDB]
    Connection successful
    Connecting to [(local)].[TargetDB]
    Connection successful

17 new CLI return error codes

In this release, 17 new CLI return error codes are introduced into ApexSQL Diff, with 22 in total.

The return error code will be shown once the application execution is finished in the CLI. Find out how to get the return error code from here.

The list of all return error codes in ApexSQL Diff, with their descriptions, is shown below:

Package option switches

In this release, CLI switches for all package options are added and all of their options can be set from the CLI. Check out the knowledgebase article here, to see all new added CLI switches under the Package switches section.

Warnings handling switch

Until now, warnings were shown only in the Synchronization wizard in the application’s GUI, and the process could be continued or stopped. From this release, the /warnings_handling CLI switch is added to allow:

  • Ignore warnings – warnings will be ignored during the application execution

  • Abort on medium or high warnings – application execution will be aborted on medium or high warnings

  • Abort on high warnings – application execution will be aborted only on high warnings

The warnings handling switch and its description can be seen in the article on this link, under the General synchronization options section.

Additionally, the Warnings output is now shown as a part of the CLI output messages.

Ignore invalid objects option and switch

The Ignore invalid objects option is added to the application’s GUI and CLI. In the application’s GUI, it’s added in the Options tab of the New project window, under the Attributes for script-based objects group:

In the CLI, it’s added as the IgnoreInvalidObjects [iio] option, for the /ignore_general switch:

It ignores enforcing of deferred name resolution. When it’s unchecked, it generates a warning if an invalid object is referenced by a procedure:

Procedure [dbo].[uspGetAddress] references an invalid object [dbo].[Addresses]
Invalid object is recognized. Use /ignore_general:iio switch in order to ignore invalid objects

Ignore new objects option and switch

By default, if a project file is saved with specific objects selected for the comparison and/or synchronization process, any new object will be automatically added and checked in the saved project file. The Ignore new objects option is added in this release to prevent adding newly created database objects to saved project files.

As previous described option, the Ignore new objects option is also added in the Options tab, under the Objects group:

As for the CLI, it’s added as the IgnoreNewObjects [ino] option, for the /ignore_general switch:

Silent switch

One more CLI switch that has been added to the Additional options is the /silent switch. It can be used when there is a need to prevent showing all CLI output messages to console.

Improved CLI output messages

With ApexSQL Diff 2016 R2 release improved CLI output messages are introduced that can be seen only when the /verbose switch is specified.

In the following example, two local databases are compared and synchronized, and Excel report will be generated at a specified location:

ApexSQLDiff.com /rc /database1:SourceDB /database2:TargetDB /synchronize /output_type:excel /on:excel_report.xml /verbose /force

  • Comparison summary – contains information about database objects that are different, missing, additional, or equal:

  • Warnings output – contains information about all warnings which are encountered before executing the synchronization script:

    Depending on which option is set for the /warning_handling switch, the appropriate message will be shown. By default, warnings will be ignored and the following message will be shown:

    Warnings will be ignored during the application execution, due to the Ignore warnings option

    • Synchronization summary – contains information about which database was synchronized, the number of warnings, and the number of objects that are updated, added, deleted, and the total number of synchronized objects:

      Warnings and Changes log files can be viewed in provided location next to the See part, as shown above.

    • Changes output – contains the number of updated, added, and deleted objects in destination database:

    August 10, 2016