xSQL Comparison Bundle for SQL Server
Where Clauses

Data compare allows you to set where clauses so that you can read and compare only the rows you need to. Any SQL Server expressions could be used as a where clause. We should validate the where clause to ensure it is defined correctly.

In order to avoid incorrect results, we recommend you include all data key columns in the where clause definition. Consider, for example, the table Employees. It has a primary key on EmployeeID field, which is the data key selected by data compare. You want to compare only the employees hired after a given date, so you add a where clause on the column HiredDate. If a record, on the source and target, with the same EmployeeID has different HiredDate, the where clause could exclude only one of them. As a result, data compare will generate an incorrect missing record on one of the databases.

Do not include the "where" keyword in the clause, just the SQL expression.

 

 

 


Copyright © 2022 xSQL Software - All rights reserved.