Compare Table Data enhancement request: Ignore PK and use selected UK

Ameen

Member²
Hello
in some cases when we want to compare the same table between 2 schemas, the data in PK in these tables is different for the same record (e.i. when use different sequence to fill the ID column(s) , or manually adding the same record in the second database (schema) but we were forced to use different ID ...), but we are sure that we can use one of the UK in the table to compare, so if we can use the UK instead of the PK, we can solve the problem.

of course, the columns in the UK in this case are not updated in the result script.

and of course this applied to (UPDATE and DELETE) options only because there is no way to fill the ID(s) for INSERT option.

For INSERT option in this case we must exclude the ID(s) from the result script and rely on the triggers to auto fill the ID(s).

For UPDATE option, the update (SET clause) is done on all columns that are:
- not in the PK
- not in the selected UK

For UPDATE and DELETE options, the WHERE clause in result script is constructed by using the columns in the selected UK.

Thank you.
 
Back
Top