June 28, 2014 at 12:03 am
hi! I have a table history of Employee data.
id | EmpNo | EmpName | MobileNo | Email | EmpSSS | UpdateDate | UpdateUser
I have to make a stored procedure that will show the history and changes made to a given EmpNo, with the UpdateDate, UpdateUser and indicate which field is modified. Ex. Employee Mobile number was changed from '134151235' to '23523657'.
Result must be:
EmpNo | UpdateDate | UpdateUser | Field changed | Change from | change to
June 28, 2014 at 5:29 am
I think, you need to have audit table which would be same as original table with
two more fields version and action .action will store if it was insert,update or delete.
create after insert ,update,delete trigger on original table.So from that audit table you can get which field is changed and updated value as well.
There can be other better approach for this.
June 28, 2014 at 8:12 am
I thought of that too, but the instruction does not let me create a new table for that.
June 28, 2014 at 5:43 pm
Is that table encrypted by any chance?
--Jeff Moden
Change is inevitable... Change for the better is not.
June 30, 2014 at 2:28 pm
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply