Click here to Skip to main content
15,741,692 members
Please Sign up or sign in to vote.
0.00/5 (No votes)

I want to identify the DML(Insert, update, delete) changes in a database along with the records in a particular table modified in SQL database.

I came accross Change Data Capture but in that way I cannot find the records modified.

Pls help.


There is very Good Functionality in sql to do the task.

Here is Good Article from codeproject...
Triggers -- Sql Server[^]

And Here is very good video for Triggers with practical examples.[^]

Hope This Help You.
Pratik Bhuva
Share this answer
If you want row data then you can go for trigger. inside sql server you can find new/deleted/modifed records.

inside trigger you find 2 special tables named INSERTED and DELETED. SQL server automatically create and mange both tables and both have same structure.

From that tables you can collect old/deleted and new row.[^]
Share this answer
Dhivya.J 4-Nov-13 3:37am    
Thank you. Is the trigger you mentioned are table and record specific?
Dhivya.J 4-Nov-13 3:38am    
I have nearly 600 tables in one DB and my SQL contains 3 databases like this. Is it possible to use trigger in this case?
S. M. Ahasan Habib 4-Nov-13 4:04am    
Yes it is possible but that type of huge triggers management might be difficult and create maintenance overhead. My suggestion is try to do it from your application logic/business logic layer with proper object oriented programming. It will help you to keep simple to your databases.

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