September 24, 2011 at 2:56 am
Hi All,
I am part of development of an erp application.I need to capture the history of data which is mandatory for capturing history..details.
Can anyone give solution-how to handle this scenario by following some Database structure..for sample.
Thnks,
Hemanth.
September 24, 2011 at 6:08 am
I am part of development of an erp application.I need to capture the history of data which is mandatory for capturing history..details.
Can anyone give solution-how to handle this scenario by following some Database structure..for sample.
Surely, You can do it typically by creating history tables with some History suffixes and add couple of more fields such as create date time and Insert into that table at the day end. You may create indexes on that table to retrieve data faster.
Regards,
Sudhir
September 24, 2011 at 12:04 pm
On of the easiest ways to do this, and it will capture any and all changes, is to do as suggested above but use some very well written triggers (and can handle more than one row at a time) to insert any changed rows into the history table for either UPDATEs or DELETEs only. It is not necessary to capture the original insert because, if no modifications are made to it, it will reside in the original table. Capturing INSERTs does nothing for you except instantly double the amount of disk space that any table-pair should take.
You'll find some folks that recomend only capturing the column name and the original data. I'll strongly recommend against that because it would require the "value" column to handle any data and you'll also be in a world-of-hurt if you ever need to reassemble rows to a given point in time.
--Jeff Moden
Change is inevitable... Change for the better is not.
September 24, 2011 at 6:35 pm
Search auditing on this site. We have numerous articles on the subject.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply