Well-Designed Interactive HTML Diff Report

When it comes to identifying and analyzing SQL schema differences, choosing an easy-to-use and multifunctional tool can be very important. Among the tools the Devart team offers, there is a powerful and reliable database schema comparison tool - Schema Compare for SQL Server. It enables you not only to significantly reduce time on SQL Server database comparison and synchronization but also view and analyze what changes were applied to the files.

Later, the result of the database comparison can be exported to one of the following file formats: HTML, XLS, XML. In the article, we are going to explore an interactive HTML comparison report type that contains the comparison analysis with a set of user interactive options. The dbForge Schema Compare tool generates a database comparison report as a read-only HTML file in which you can include filtered objects or objects selected for synchronization, or only objects with differences. In addition, it displays the deployment script, warnings, modified changes, comparison and synchronization options.

The HTML comparison report type enables you to:

  • Quickly navigate through the report
  • View the changes applied
  • Analyze DDL differences between database objects in two compared SQL schemas
  • View the script with the highlighted rows and columns having differences
  • Share the report with the team

How to generate an HTML diff report

To get started, download and install dbForge Schema Compare for SQL Server, and then compare two SQL Server databases by following the steps in the Comparing schemas documentation topics.

After data sources are compared, you will see the comparison results in the Results window that can be further synchronized and exported to HTML, XLS, or XML data reports.

To generate an HTML comparison report, do the following:

1. On the Comparison menu, click Generate Comparison Report.

2. In the Comparison Report dialog, select the HTML file format, specify a file location, and set report options to customize it:

  • Append timestamp to the file name: Adds date and time to the file name
  • View report on the completion (selected by default): Opens the comparison report after generation
  • Include section: Adds objects to be compared to the report:
    • All objects
    • Filtered objects
    • Objects with differences
    • Objects selected for synchronization
  • Options section: Includes the following options in the report:
    • Compare and sync options
    • Warnings
    • Deployment script
  • Script-Diffs Style section: Displays the differences in columns and rows in the specified style format:
    • Removed-added lines (selected by default)
    • Crossed out words
Select an HTML comparison report

2. To generate a report, click Generate.

Overview of the diff report elements

Let's have a closer look at each section the report has.

Report header

The report header displays information that includes:

  • Date when the report was created
  • Expand all control to open all expandable items
  • Collapse all control to close the expanded items
  • Source and target databases to be compared along with the servers they are connected to
View the HTML report header

Changes section

The Changes section displays objects grouped into categories. You can see the number of objects next to each category:

  • Added
  • Removed
  • Modified
  • Identical
  • Inconsistent
  • Unknown

In addition, you can expand the DDL script for each object to be compared by clicking the object in the interactive HTML report.

View the changes section of the HTML report

Warnings section

The Warnings section displays warnings or informational messages that require the user's attention.

View the warnings section of the HTML report

Script section

The Script section displays a synchronization script that you can execute to synchronize schemas.

View the script section of the HTML report

Options section

The Options section is divided into two groups: Comparison displaying comparison options and Synchronization displaying synchronization options.

View the options section of the HTML report

HTML diff report with removed-added lines

Upon the report generation, the report with the Removed-added lines option will have the following view in the Modify section. The new text will be highlighted with the green color while the old one - with the pink color.

View the HTML report with the Removed-Added lines option

HTML diff report with crossed out words

When the Crossed out lines option is selected, the report will have a different view in the Modify section. The old text will be struck out and highlighted with a pink color.

View the HTML report with the Removed-Added lines option