Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2005
»
SQL Server Newbies
»
Tracking data changes in SQL 2005 using a...
Tracking data changes in SQL 2005 using a trigger
Rate Topic
Display Mode
Topic Options
Author
Message
akhale123
akhale123
Posted Monday, February 23, 2009 10:29 AM
Forum Newbie
Group: General Forum Members
Last Login: Thursday, February 26, 2009 6:33 AM
Points: 6,
Visits: 17
I read that to track data changes in SQL 2005, I'll need a trigger. I need help creating the trigger and having it work.
Example: I need to track data changes on table 1, columns A, E and F
I need to know what the change was, who made the change and the date and time the change was made.
Is there another easier way to track data changes??
Post #662767
Steve Jones - SSC Editor
Steve Jones - SSC Editor
Posted Monday, February 23, 2009 10:39 AM
SSC-Dedicated
Group: Administrators
Last Login: Today @ 3:19 PM
Points: 31,526,
Visits: 13,863
A trigger will do this, or you can read the log later if you buy a tool.
http://www.sqlservercentral.com/articles/Security/sqlserverauditingpart1/1451/
Follow me on Twitter:
@way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
Post #662776
akhale123
akhale123
Posted Monday, February 23, 2009 11:10 AM
Forum Newbie
Group: General Forum Members
Last Login: Thursday, February 26, 2009 6:33 AM
Points: 6,
Visits: 17
I would need the T-SQL script for creating the table that will hold info on data changes and creating the trigger using the table and columns I gave in the example.
Post #662799
GSquared
GSquared
Posted Monday, February 23, 2009 11:27 AM
SSCoach
Group: General Forum Members
Last Login: Yesterday @ 1:45 PM
Points: 15,442,
Visits: 9,572
Check out these articles, and the discussions. Plenty of sample code to set up audit logging.
http://www.sqlservercentral.com/articles/Auditing/63247/
http://www.sqlservercentral.com/articles/Auditing/63248/
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
Post #662813
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.