Question

Using Redgate SQL Data Compare 9.

This is a simplified example of what I want to do. I have the following tables:

Product (ProductId, ProductName)         
ProductDetail (ProductDetailId, ProductId, OtherField)

Id columns in both tables are primary keys and auto-increment (identity). Product has a unique constraint on ProductName. I have a production system and a test system, and would like to use Data Compare to sync the ProductDetail tables of the two systems.

The problem is that the two systems' id columns are not synchronized. A product called "Bananas" could have an Id of 1000 in production and an Id of 6 in test.

What I would like to do is compare using a join--so instead of using a key made up of only columns in the ProductDetail table, I could compare based on a combination of fields using both the Product and ProductDetail tables.

I don't see any way of having more than one table participate in a comparison in the Data Compare UI. Is what I'm trying to achieve possible?

Was it helpful?

Solution

using a query with the desired join condition, create a table with the results on each db and use rg to compare those tables

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top