Solved

Create MS SQL 2005 Changes Log

Posted on 2009-05-04
5
219 Views
Last Modified: 2012-05-06
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
0
Comment
Question by:CABHugh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 31

Expert Comment

by:RiteshShah
ID: 24302127
well, you can create audit trail trigger. small examples are here.

http://www.sqlhub.com/2009/03/auditing-trail-with-trigger-in-sql.html
0
 
LVL 31

Accepted Solution

by:
RiteshShah earned 500 total points
ID: 24302133
0
 

Author Comment

by:CABHugh
ID: 24302376
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
0
 
LVL 31

Expert Comment

by:RiteshShah
ID: 24302382
sure, will wait for your update.
0
 

Author Closing Comment

by:CABHugh
ID: 31577907
Links provide that gave me the solution I needed.  Thank you.
0

Featured Post

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I am showing a way to read/import the excel data in table using SQL server 2005... Suppose there is an Excel file "Book1" at location "C:\temp" with column "First Name" and "Last Name". Now to import this Excel data into the table, we will use…
INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question