We have an existing system, where data is imported from file.
We have a procedure which imports data from file to data_table. File have a unique column with TID
, if this TID
exists in data_table it simply updates else inserts a new record into data_table. For this each activity (insert/update)
we are inserting value into other tables called track_table which inserts new row into this table for each activity. Meaning if data_table table is updated/inserted
it will create new record into track_table for tracking purpose.
track_table looks like.
Id, DATE
, TID
, TEXT
Here, we have multiple same TID's for each activity. Id column is for identifying record uniquely. Now, we are looking to prevent inserting every time into track_table if record in data_table already exists.
I believe we can also do this by comparing each field into file with filed in table, but would be glad to know for some other solution.
Looking for your suggestions. Thank you.