There are 2 databases. Database 1 has same number tables but does not contain old record, whereas Database2 has all the records. Now I want to build a new table containing all the unmatched records between two tables.
for Ex. Table1
ID dateCreated doesExist
3001 12:01:12 Y
3002 15:23:08 Y
Table2
ID dateCreated doesExist
1001 21:09:56 N
3001 12:01:12 Y
3002 15:23:08 Y
Required new table Table3
sourceTable DesTable ID dateCrated doesExist
Table1(name) Table2(name) 1001 21:09:56 N
So far I'm able to get the unmatched records using the outer Join condition. But how do I store that as records in new table also containing the table name of source and destination.
New table has to contain the table name of both sourceTable and destTable as there are many tables in databases.