itsmarkdavies
Programmer
Can anyone suggest some sql to discover the changes between 2 tables. The contents of the tables used to be identical, but I have deleted data from ONE of the tables. I need to find out what I have deleted.
I thought about using this :-
SELECT * FROM TABLE1 WHERE
TABLE1.FIELD1 NOT IN (SELECT FIELD1 FROM TABLE2) AND
TABLE1.FIELD2 NOT IN (SELECT FIELD2 FROM TABLE2) AND TABLE1.FIELD3 NOT IN (SELECT FIELD3 FROM TABLE2)
...etc
but I cannot be sure it is working properly due to the vast number of records. Any ideas ? Thanks.
I thought about using this :-
SELECT * FROM TABLE1 WHERE
TABLE1.FIELD1 NOT IN (SELECT FIELD1 FROM TABLE2) AND
TABLE1.FIELD2 NOT IN (SELECT FIELD2 FROM TABLE2) AND TABLE1.FIELD3 NOT IN (SELECT FIELD3 FROM TABLE2)
...etc
but I cannot be sure it is working properly due to the vast number of records. Any ideas ? Thanks.