March 16, 2008 at 5:23 am
Do we have some script to run with sys tables to get auditing/tracking information for a record. Like who inserted this record, how and when ???
March 16, 2008 at 9:38 am
This can be best implemented with either C2 auditing or DML triggers.
It should be mentioned that C2 auditing logs alot of information, maybe for than you need. This excessive logging consumes a lot of disk space and can degrade performance. You can enable C2 auditing by going to the server properties.
DML trigger require you to create triggers on each table that you want to participate in auditing. You can capture when a record is updated, inserted or deleted, who deleted it, and when it was deleted.
C2 auditing
http://www.sqlservercentral.com/articles/Monitoring/basicsofc2auditing/1547/
DML Triggers
script to create trigger on all tables http://www.sqlservercentral.com/scripts/Maintenance+and+Management/31950/
http://www.sqlservercentral.com/scripts/Miscellaneous/31073/
More Info:
http://www.sqlservercentral.com/articles/Administering/auditingyoursqlserverpart1/917/
http://www.sqlservercentral.com/articles/auditingyoursqlserverpart2/933/
http://www.sqlservercentral.com/articles/auditingyoursqlserverpart3/946/
March 16, 2008 at 9:37 pm
There's no way to go back and get this. A log reader might help if you really need one. Check out ApexSQL for a tool to help if you need it.
March 16, 2008 at 9:41 pm
The short answer is NO and sys.tables won't tell you a thing about this.
--Jeff Moden
Change is inevitable... Change for the better is not.
March 17, 2008 at 12:18 am
SQL Server 2008 would have this feature out-of-the-box.
its called Change data capture (CDC)
March 17, 2008 at 12:23 am
Balmukund Lakhani (3/17/2008)
SQL Server 2008 would have this feature out-of-the-box.its called Change data capture (CDC)
That's nice... got anything for 2005?
--Jeff Moden
Change is inevitable... Change for the better is not.
March 17, 2008 at 12:34 am
I would repeat your answer "NO" 😀
March 17, 2008 at 6:40 am
Balmukund Lakhani (3/17/2008)
I would repeat your answer "NO" 😀
Thanks... I was hoping that maybe I missed a trick... I'm fairly new to 2k5 and don't yet know all the "secrets". Thanks for the feedback. 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
March 17, 2008 at 7:05 am
SQL Server 2008 would have this feature out-of-the-box.
its called Change data capture (CDC)
Interesting..
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply