Setting Up a Database Data Comparison

www.altova.com Print this Topic Previous Page Up One Level Next page

Home >  Tutorials > "ZooDB" Database > Comparing Database Data >

Setting Up a Database Data Comparison

The tutorial folder of you DatabaseSpy installation contains a Microsoft Access 2003 database which serves as a backup database for the tutorial "zoo" database. In this step of the tutorial, you will add this database to your tutorial project and select the tables in both databases for comparison.

 

 

To add the ZooDB-Backup data source to your project:

1.In the Project window, right-click the Data Sources folder and select Add a New Data Source... from the context menu.

tab_project-add-data-source

2.In the Add a Data Source dialog box, choose the Microsoft Access ( ADO ) option button and click Next.
3.On the Connect to MS Access page, click the Browse button and navigate to the tutorial folder (\Altova\DatabaseSpy2019\DatabaseSpyExamples\Tutorial sub-folder of the Documents folder).
4.Select the ZooDB.mdb database and click Next.
5.In the Set A Data Source Name dialog box, enter "ZooDB-Backup" and click OK. The data source is added to the project and a connection to it is automatically established.
6.Click the Save Project ic_save_project button in the Project window toolbar or press Ctrl+S.

 

Opening a Data Comparison window

DatabaseSpy provides a Data Comparison window which is used to select and map tables, start a comparison, and merge data of the compared tables. Opening a Data Comparison window and selecting the tables (and columns) to be compared is usually done in a single step.

 

 

To select tables for comparison:

1.Click the Data Comparison ic_data-comparison button in the Standard toolbar or select the menu option File | New | Data Comparison. A new Data Comparison window is opened and the Select Database Objects for Comparison dialog box appears, where the first data source connection, ZooDBConnect, is preselected in the Data Source drop-down list, and the Left Side button is activated by default.
2.Expand the tree structure in the selection dialog box until the tables are displayed and activate the User Tables check box. This selects all tables in the User Tables folder.

dlg_select-tables-left

3.Click the Right Side button and select "ZooDB-Backup" from the Data Source drop-down list.

dlg_select-data-source

4.Expand the tree structure in the selection dialog box until the tables are displayed and activate the User Tables check box. This selects all tables in the User Tables folder.

dlg_select-tables-right

5.Click OK. The tables appear in two separate components of the Data Comparison window, and matching tables and columns are mapped automatically.
6.Select the menu option Data Comparison | Collapse tables or select this command from the context menu that opens when you right-click the header of either component in the Data Comparison window.

diff_mapping-unsorted

7.Optionally, if the sort order is different in the left and right component, select the menu option Data Comparison | Sort tables | Ascending or select this command from the context menu that opens when you right-click the header of either component in the Data Comparison window.

© 2019 Altova GmbH