June 14, 2004 at 10:56 am
Hi, I am copying data from several sql2000 databases into a central database, this db is not a true datawarehouse, but just a storage area for reports. My question is, I need to detect changes in the production db, if there is a change then I want to copy that data and the related info to the storage db, if no change then don't do anything.
I looked at Binary_CheckSum, but I would have to follow what it says for 100,s of tables, not practical from my point of view.
Has anyone encountered this? If so how did you solve it.
Thanks
Gary
June 14, 2004 at 1:51 pm
My suggestion is add a column (tinyint) and default to 1 on insert. Set all existing rows to 0 and then place a trigger to update the rows affected on update where column = 0.
Then when you run to match first set all 1's to 2's then do your update and finally set all 2's to 0's.
Basically
0 = unaffected
1 = changed
2 = processing
If you are worried with deletes create an audit table to store the key for any deleted field so you know what to do.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply