Compare 2 datatables & return diffs

  • Thread starter Thread starter jon.ely
  • Start date Start date
J

jon.ely

Hi all

Right here is the deal.

I want to compare 2 data tables and return the differences. These are
the details

1) I populate a datatable from a sql stored proc
2) I run the stored proc again & now I want to compare the new data to
the original datatable & return only the differences, the changes will
only come from the db side.

Any help would be great

Cheers

Jon
 
Here is one suggestion on how to do this:

Give all non-key columns in the second table names different from that of
the first table.
Merge the two tables, and have the merge add columns not present
Call Select on the datatable, and make the where clause something like "Col1
<> Col1Dup Or Col2 <> Col2Dup", which should basically get all the places
where there are any differences.
 
Back
Top