I want to track any changes made to a table, any row and column data.
I am creating the following manually:
I made an update stored procedure. shown is sort-of pseudo code.
I don't need hekp with the code per-se and it may not be 100% syntax
it accepts 6 parmeters. one is for each column name.
Create Procedure ChangeMe
Update myTable
Set Col_1 = @Parm1, Col_2 = @Parm2 .... etc
Where UniqueRecordID = @RecordId passed in parameter 6.
then I wanted to look up the record before it was updated and get the values. I have another table called AuditTrail with these columns
@LastName ,
@FirstName ,
@Tablename,
@ColumnName,
@DataChanged,
@RecordUniqueID,
@DateRecordEdited
I was going to add one record to it based on every column that changed.
your Thoughts, ideas, quicker ways
DougP
I am creating the following manually:
I made an update stored procedure. shown is sort-of pseudo code.
I don't need hekp with the code per-se and it may not be 100% syntax
it accepts 6 parmeters. one is for each column name.
Create Procedure ChangeMe
Update myTable
Set Col_1 = @Parm1, Col_2 = @Parm2 .... etc
Where UniqueRecordID = @RecordId passed in parameter 6.
then I wanted to look up the record before it was updated and get the values. I have another table called AuditTrail with these columns
@LastName ,
@FirstName ,
@Tablename,
@ColumnName,
@DataChanged,
@RecordUniqueID,
@DateRecordEdited
I was going to add one record to it based on every column that changed.
your Thoughts, ideas, quicker ways
DougP