If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Ways to store audit trail

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-29-10, 17:13
mnirwan mnirwan is offline
Registered User
 
Join Date: Sep 2009
Posts: 64
Ways to store audit trail

Hello,

For storing changes to records in table, I think there are 2 ways to do it (there may be more but I know of 2 ways)

1. Using trigger so that for any updates to table A ... it will automatically trigger an insert to table A_log for the previous value.

2. Using just 1 table (like table A) and simply just insert new records every time. Then on SELECT, get the latest one that matches criteria. (well, or have a column that says active/inactive or something like that)

Of these 2 approach, which design (and why) is better? Also, if there's another way to do this, I'd like to hear about it.

Thanks,
MSN
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On