In the database design I'm working on, one of the major concerns is tracking changes and who made them. I'm trying to decide the best way to implement this tracking.
This database is being designed to replace the Platypus Database (see Thread655-606833 and Thread655-846108). We need to be able to see who updated name, address, SSN, phone, any personal information. So if I have this record:
tblDefendantMaster
DefendantID: 12515
DefendantFName: Joe
DefendantMName:
DefendantLName: Blow
Address: 123 Main St
City: Albuquerque
State: NM
HomePhone: 555-1212
My question is should I:
1. Create a duplicate table (tblPreviousPersonalInfo) and add the entire record whenever ANYTHING is changed and add fields for who changed and when. So, the record in tblDefendantMaster is copied as is to the PreviousInfo table with the name and update date, and the information in the Master file is updated with the newest information.
2. Create a table that stores the individual item that was changed. So if Joe came in and changed his phone number I would store the old number in tblPreviousInfo along with the field that was changed and who changed it and when. So I would have a record:
DefendantID: 12515
FieldChanged: HomePhone
OldInfo: 555-1212
ChangedBy: USER1
ChangedOn: 8/9/2004 9:15:25 am
3. Any time information is changed, add a new record to tblDefendantMaster referencing the last DefendantID record. For instance, if we changed the phone number:
tblDefendantMaster
DefendantID: 16805
DefendantFName: Joe
DefendantMName:
DefendantLName: Blow
Address: 123 Main St
City: Albuquerque
State: NM
HomePhone: 555-2121
ChangeReference: 12515
So I add a new record for Joe with the correct phone number and reference the "old" ID number in the "new" record. Then to get the history I would need to self join through the ChangeReference field.
Any ideas on the best way to implement this? Thanks for your suggestions!
les
This database is being designed to replace the Platypus Database (see Thread655-606833 and Thread655-846108). We need to be able to see who updated name, address, SSN, phone, any personal information. So if I have this record:
tblDefendantMaster
DefendantID: 12515
DefendantFName: Joe
DefendantMName:
DefendantLName: Blow
Address: 123 Main St
City: Albuquerque
State: NM
HomePhone: 555-1212
My question is should I:
1. Create a duplicate table (tblPreviousPersonalInfo) and add the entire record whenever ANYTHING is changed and add fields for who changed and when. So, the record in tblDefendantMaster is copied as is to the PreviousInfo table with the name and update date, and the information in the Master file is updated with the newest information.
2. Create a table that stores the individual item that was changed. So if Joe came in and changed his phone number I would store the old number in tblPreviousInfo along with the field that was changed and who changed it and when. So I would have a record:
DefendantID: 12515
FieldChanged: HomePhone
OldInfo: 555-1212
ChangedBy: USER1
ChangedOn: 8/9/2004 9:15:25 am
3. Any time information is changed, add a new record to tblDefendantMaster referencing the last DefendantID record. For instance, if we changed the phone number:
tblDefendantMaster
DefendantID: 16805
DefendantFName: Joe
DefendantMName:
DefendantLName: Blow
Address: 123 Main St
City: Albuquerque
State: NM
HomePhone: 555-2121
ChangeReference: 12515
So I add a new record for Joe with the correct phone number and reference the "old" ID number in the "new" record. Then to get the history I would need to self join through the ChangeReference field.
Any ideas on the best way to implement this? Thanks for your suggestions!
les