This walkthrough will show you how to use the main features of Table Diff.

Step 1: Select the tables to compare using the wizard

As soon as you run Table Diff, the wizard will launch. The first step of the wizard allows you to specify the tables that you wish to compare.

The first step of the comparison wizard.

The screen allows you to select an existing server connection. If this is the first time you are using Table Diff, then you can click the “New” button to create a new server connection.

The New Connection dialog

Table Diff will remember the details of the connection (including the password, if you wish so) so that you do not have to re-enter them next time. If you allow Table Diff to save the password, then be assured, Table Diff will encrypt it before saving it.

Things to remember:

  • You can compare tables on different SQL Server instances;
  • You can compare tables held in different versions of SQL Server (e.g. compare between SQL Server 2005 and SQL Server 2008 to verify that the data migration was successful).

Step 2: Map the columns and specify the unique key

Once you have selected the tables to be compared, you will be brought to the second step of the wizard. This screen will allow you to:

  1. Specify how to map columns;
  2. Specify the unique key to be used for the comparison.

Comparison Wizard Step 2

Table Diff automatically retrieves the columns for you and automatically maps those that have same name and same data type.

Table Diff also automatically retrieves the existing unique keys from the two tables, so that you can simply select the one you want to use. Alternatively, you can specify a custom unique key by checking the appropriate check boxes in the “Part of Unique Key” column.

Step 3: Define which records you want to see

In order to improve performance, it is possible to only compare and display records that have certain characteristics. For example, instead of returning the full data set, we could ask Table Diff to only return records that are missing from one of the two tables or that are found in both tables but have different non-key attributes. This is achieved by selecting the “Only different and missing records” option.

Comparison Wizard Step 3

The Comparison Grid

Once you have completed the wizard, the grid will show you the data differences between the two tables. Differences are highlighted in green.

The comparison grid.

You can use the “Next Different Row” and “Previous Different Row” buttons to easily navigate through the grid. This is particularly useful when you have a large record set and only few records are different.

Eliminating differences using the smart context menus

A context menu will be shown whenever you right click on:

  • One or multiple different rows;
  • A different cell value;
  • A different column;
Example Row Context Menu

Example Row Context Menu

Example Column Context Menu

Example Column Context Menu

Example Cell Context Menu

Example Cell Context Menu

The context menu will allow you to:

  • Eliminate the data difference directly;
  • Generate a SQL script for eliminating that particular data difference;

You can select multiple rows by keeping pressed the CTRL key and clicking on the desired rows or alternatively by keeping pressed the SHIFT key and pressing the UP and DOWN ARROW keys.

Generating the Synchronization Script

You can use the “Include” check box and the direction arrows to define which differences should be eliminated. Once you have completed selecting the differences that should be eliminated, you can click the “Generate SQL” button in the toolbar. This will generate a synchronization script in SQL, which you can either execute directly or save to a file for later use.

View and Execute SQL

We strongly advice in downloading a 30-day fully functional copy of Table Diff and trying it for yourself! Please let us know if additional information is required. We’d love hearing from you.