How to use parent tables to compare child tables that have different unique id's?
JDSX
Posts: 3 Bronze 1
This is a common problem for us when using Data Compare. Parent table has unique constraint on a char field alongside an identity field which also serves as a one-to-many foreign key in the child table. The child table uses an identity field to distinguish each row but there's no guarantee the id's will be the same across databases so only the parent can be matched but the child table only has the parent_id identity fk which is not a viable comparison key.
John D. Shkolnik
VP, Product Management | Managed Services & Products
Deloitte Risk and Financial Advisory
Deloitte & Touche LLP
VP, Product Management | Managed Services & Products
Deloitte Risk and Financial Advisory
Deloitte & Touche LLP
Tagged:
Best Answer
-
sam.blackburn Posts: 224 Gold 2You'll probably need to create a view (in each database) joining the two tables, enable the "include views" option and select a comparison key using the Tables & Views tab. If you want to deploy data, you might also need to create an insert trigger on the view.Software Developer
Redgate Software
Answers
Hi,
That'd be ok for a workaround although I can't say I'd be thrilled by the added overhead and "pollution". A better solution would be adding a sort of computed comparison key to Data Compare.
VP, Product Management | Managed Services & Products
Deloitte Risk and Financial Advisory
Deloitte & Touche LLP
Redgate Software
VP, Product Management | Managed Services & Products
Deloitte Risk and Financial Advisory
Deloitte & Touche LLP