News  
  By label  
  By team  
  By product  

ApexSQL Blog

Product announcements, promotions and other ApexSQL news


Benefits of using the Row filter in ApexSQL Data Diff

You are using ApexSQL Data Diff and you have to compare a predefined range of data in two SQL tables located in different databases and on different servers, but these tables are with more than 100 million records. A full table comparison would be too time-consuming and could deteriorate the network and server performance
Using the ApexSQL Data Diff’s Row filter to compare just the defined range of data, can boost the comparison performance, and shorten the time required to complete the process
The following is an explanation of how to do that:

1. On the Home tab, in the Projects group, click either New or Edit. This will open the Project dialog
2. If the data sources have already been selected, go to the next step. Otherwise, select the data sources now
3. At the bottom of the Project dialog, click Show advanced tabs

4. On the left of the Project dialog, click Object filter. This will display the object filter page, which contains a list of objects in both source and destination data sources



In the Object filter grid, navigate to the Columns drop-down menu where you can see the columns used for the table that you want to compare



In this example, customers will be filtered by the CustomerID. Click on the Row filter field of the table you want to compare, and then click on the ellipses button



The Row filter for Customer dialog will appear where you need to enter the condition that fulfills the comparison requirements. CustomerID >=1000 and CustomerID <=20000 
In this example, the condition filters the customers with IDs from 1000 up to 20000

At the bottom of the dialog, you can see the Row counts – it is the number of rows that fulfill the given condition. In this example, it is 9000 (marked with a red arrow)

If needed, several columns can be used in a single condition applying AND and OR operators, like in the standard T-SQL

This condition is what ApexSQL Data Diff will inject as the WHERE condition, while selecting from the database. So everything that can be used in the WHERE clause of a T-SQL query, can be used here as well




Author Nikola Dimitrijevic

Labels: ,