Comparing Database Data Print this Topic Previous Page Up One Level Next page

Home > 

Comparing Database Data

You can compare data from two or more tables or columns side-by-side. The objects to be compared can either belong to the same database, or reside in two different databases. A database comparison is similar to file comparisons; that is, it involves a "left" component and a "right" one. A "component" is just a representation of the database structure from where you can conveniently select the tables or columns that are to be compared.


Database data comparison

After comparing database data, you can optionally merge differences either from left to right, or from right to left. It is possible to merge all differences as one batch, or you can display the differences for each table in a data grid, and then review and merge each difference individually at row level.The changes can be either committed directly to the database, or be saved as a merge SQL script for later execution. Optionally, you can generate restore scripts as well. A restore script reverts the effects of a merge script and renders the database to the original state before the merge. For more information, see Displaying Differences in Databases and Merging Database Differences.


If you perform the same data comparison frequently, you can save it to a file (.dbdif) which can later be opened either in DatabaseSpy or in DiffDog, see Database Data Comparison Files.



An active connection to a data source must exist in your project (see Connecting to a Database). If you are comparing data from two databases, then you will need a connection to each database (to populate the "left" and "right" components, respectively).
If you are comparing tables, each table must have a primary key column. DatabaseSpy requires the primary key column to sort the table rows before performing the actual comparison.

© 2019 Altova GmbH