3

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?

Phil Sandler
  • 27,544
  • 21
  • 86
  • 147

1 Answers1

2

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

mikeg
  • 36
  • 1
  • 2
    I'd recommend creating a View to do this as SQL Data Compare can also compare views (although this needs to be enabled in the options) – David Atkinson Feb 04 '13 at 22:05