comparison key in related table

Compares and synchronizes SQL database content.

Moderators: JonathanWatts, Chris Auckland, David Atkinson, Michelle Taylor, chengvoon.tong

comparison key in related table

Postby stp » Tue Aug 21, 2012 2:38 pm

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
stp
 
Posts: 1
Joined: Tue Aug 21, 2012 2:15 pm

comparison key in related table

Postby contisma » Fri Jul 12, 2013 4:22 am

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?
contisma
 
Posts: 1
Joined: Fri Jul 12, 2013 4:19 am
Location: Perth, Australia

Postby wdhenrik » Tue Jul 16, 2013 12:00 am

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
wdhenrik
 
Posts: 12
Joined: Thu Jul 19, 2012 11:58 pm


Return to SQL Data Compare 10

Who is online

Users browsing this forum: No registered users and 1 guest