Click here to Skip to main content
15,561,246 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
I am using SQL2008.

I want to generate log file of each and every transaction carried out on my table.

How can i do this?
Posted

You could use transaction logging for that:
http://www.databasedesign-resource.com/sql-server-transaction-log.html[^]

Good luck!
 
Share this answer
 
Depending on what you mean by log file, look up Create Trigger in BOL. They would enable you to log changes to a table.
 
Share this answer
 
Easy solution is...

Create another table similar to the one for which you want the log.
Add new field as Type for operation performed on the record (Like I for Insert New, D for Delete, UD REcord before update (from deleted table when update operation is performed) and UN for New record after updated (form inserted).

Use that log table to trace the activity... etc
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900