Options

comparison key in related table

stpstp Posts: 2
Hi there,

I want to compare two tables(lets call them tblPeople). The datasets have a column 'Id' which is linked to another table(tblRegistry). The Id columns are not the same in the two databeses but in every db itself the Id in tblPeople matches the Id in tblRegistry. The tblRegistry has a column XId. So every dataset in tblPeople is connected via the Id to a XId in tblRegistry and the XIds are matching overall the two databases.

Now I want to compare the tables tblPeople with the comparison key XId from tblRegistry.

How can I do that and is it possible via commandline?

Thanks
stp

Comments

  • Options
    looking for the same solution if it is possible?

    How to set a comparison key that will pull in a value from another table to link on?
  • Options
    wdhenrikwdhenrik Posts: 15 Bronze 1
    Just to ensure I'm understanding your situation, you want to compare the join of two tables with the same table join in another database, ignoring the column used in the join condition.

    If that is correct, create a view in both locations that generates the results you want to compare. Perform the comparison using these views, set a logical Key value (e.g. XId?) and ignore the real PK column differences.

    **Update**
    I just tried comparing views and they don't appear in SQL Data Compare, even though the tab indicates they are comparable. I've created another forum post for this.
    *Answered*
    http://www.red-gate.com/MessageBoard/vi ... hp?t=17810
Sign In or Register to comment.