1
votes

I am inserting data into target table on daily basis(once in a day) from source table. I want to insert only new records into target table to avoid duplicate. I want to keep old record in target table if data changes in one field, It should insert new record and expire old record in Target table. I want to keep old record as well. I think this problem is related to CDC. I am using only Teradata, no other third party tools. Could you please help me to solve this problem using SQL?

@JNevill: If you could help me to solve this problem. - Anuj Mishra
If you are using pure SQL, then for each row, you have to compare every single column you use to determine if the record is new between the 2 tables. Based on that you can decide what to do. - Andrew
Yes, I am trying to figure out how to scan old records and match with new records Since I have an stored procedure which populate data from Source table to target table. - Anuj Mishra