CABHugh
asked on
Create MS SQL 2005 Changes Log
I wish to create a changes log for many of my tables in a MS SQL 2005 DB.
I will shortly be allowing our 26 shops access to our main database. They will be able to edit data. Because of this I need a simple log of what they change! I would like to record to a single table the following data:
Table Name, ID of Record Changed, Field Changed, Old Value, New Value, Date/Time, User.
I will then display this information to Managers & Supervisors in a simple Access DB form so we can see what they are actually doing.
Has anyone got an example of the code I require. I'm a relative beginer with SQL so a simple Copy/Paste solution would be great!
I've seen various ways of doing this type of thing but could really do with
I will shortly be allowing our 26 shops access to our main database. They will be able to edit data. Because of this I need a simple log of what they change! I would like to record to a single table the following data:
Table Name, ID of Record Changed, Field Changed, Old Value, New Value, Date/Time, User.
I will then display this information to Managers & Supervisors in a simple Access DB form so we can see what they are actually doing.
Has anyone got an example of the code I require. I'm a relative beginer with SQL so a simple Copy/Paste solution would be great!
I've seen various ways of doing this type of thing but could really do with
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi
Thanks for these. I 've just had a look and am going to test http://www.codeproject.com/KB/database/AuditTrailGenerator.aspx first. I know that this will create plenty of bloat but it really does give me a simple solution to restore data as I choose (if required!).
I'll let you know how I get on.
Regards
Thanks for these. I 've just had a look and am going to test http://www.codeproject.com/KB/database/AuditTrailGenerator.aspx first. I know that this will create plenty of bloat but it really does give me a simple solution to restore data as I choose (if required!).
I'll let you know how I get on.
Regards
sure, will wait for your update.
ASKER
Links provide that gave me the solution I needed. Thank you.
http://www.sqlhub.com/2009/03/auditing-trail-with-trigger-in-sql.html