Comparing data where primary key values do not match
EvilCube
Posts: 2
Hi,
I have a requirement to compare two sets of data that share different primary key values. The data itself can either be located within the same database or another one that might be hosted by a different SQL Server instance. So far I have been able to specify a particular filter to use by using the Where property of the TableMapping class. The problem is that this applies the same SQL where clause to both ranges of data to compare, which is not the result I would like.
I'm not sure if I am missing an option or some other method/property on the API or whether this is just a limitation of the API at present. If someone could let me know if what I am trying is possible or not then that would be a great help.
Thanks,
--Chris
I have a requirement to compare two sets of data that share different primary key values. The data itself can either be located within the same database or another one that might be hosted by a different SQL Server instance. So far I have been able to specify a particular filter to use by using the Where property of the TableMapping class. The problem is that this applies the same SQL where clause to both ranges of data to compare, which is not the result I would like.
I'm not sure if I am missing an option or some other method/property on the API or whether this is just a limitation of the API at present. If someone could let me know if what I am trying is possible or not then that would be a great help.
Thanks,
--Chris
Comments
I hope that you can get this data comparison to work given the way that Data Compare Engine works by matching rows of data according to the primary key value. If you have a workaround, say, using other columns as keys besides the primary key, then the second part shouldn't present a challenge -- it is possible to specify two different where clauses for each database's table.
The code would look something like this:
Note that this is foreach tablemapping in tablemapping, pretty basic stuff.