Compare data in two tables within the SAME database
weswinkler
Posts: 54 New member
SQL Data Compare is great for comparing one database against another. But, is there a simple way to set up a data comparison of two tables within the same database?
I'm testing two different ways of calculating some data, which ends up in a table (MyTable) of close to a million rows. I'd like to calculate one way, then take a copy of my data, perhaps via
SELECT *
INTO MyTable_Copy
FROM MyTable
Then, I'd clear MyTable and re-calculate the second way. I know the column structure would be identical between MyTable and MyTable_Copy. I'd like to compare the data in the two tables. A bonus would be having the ability to compare only some of the columns in the tables. (E.g, I don't care about Timestamps of "ModifiedDate" and the like; just other data columns.)
Thanks for any assistance.
I'm testing two different ways of calculating some data, which ends up in a table (MyTable) of close to a million rows. I'd like to calculate one way, then take a copy of my data, perhaps via
SELECT *
INTO MyTable_Copy
FROM MyTable
Then, I'd clear MyTable and re-calculate the second way. I know the column structure would be identical between MyTable and MyTable_Copy. I'd like to compare the data in the two tables. A bonus would be having the ability to compare only some of the columns in the tables. (E.g, I don't care about Timestamps of "ModifiedDate" and the like; just other data columns.)
Thanks for any assistance.
Comments
Just set up a project with the same database on both sides.
First, unmap all the tables on the Object Mapping tab.
Then, re-map MyTable to MyTable_Copy, and select the columns I want.
This gives me exactly what I want.