
HELP comparing table data....
Quote:
>I have two tables. One is a temp table that is imported by a user. It
>contains the same layout as the one in the database. I want an easy way to
>compare the data. The premise is that one user can export their data and
>another can upload it into their table.
Seems reasonable enough so far.
Quote:
>I want to test each field in each
>row and then delete the new data (temp table) if it is different. The
>remaining recordset will be appended with Select Into.
This seems backward. If the new data is different from the old, you
delete the new data? Then append the new data that is really not new?
And SELECT INTO only creates new tables, so it can't append at all.
I think there are four situations that come up in the comparison. If
you explain what you want to do with each one I am sure you will get
some answers.
1) Rows in the Temp version that are not in the Prod version. Do you
want to INSERT them into PROD?
2) Rows in the Prod version that are not in the Temp version. Do you
want to keep them around, or delete them?
3) Rows in both Temp and Prod with differences in non-key columns. Do
you want to UPDATE these rows in Prod? DELETE them from PROD and then
INSERT them from Temp?
4) Rows in both Temp and Prod with no differences in non-key columns.
Do you want to just keep them around?
Roy