Sunday, February 19, 2012

CAPTURE DML FROM TRIGGER

Hi All!

SQL Server 2000

I've situation where I've to capture a DML executing against let say Table1 and later may at the end of the day or week I want to be able to extract all the DML executed against Table1 and execute them against similar tables on different sql server to synchronize the data. I don't want to use profiler as this is quite expensive resource for my problem niether can use any third party tool.

Is it possible to capture sql statement in the trigger?

I hope I made my question clear. Urgent help will be highly appreciated.

--Sohail.

There is no way to obtain this information accurately in SQL Server right now. So you will have to run a Profiler trace on the desired table and filter the statements. We are considering adding support for obtaining the DML statement that caused a trigger to fire in a future release.|||

If you're just capturing the DML to replicate it on a different server then do you need the actual DML?

Why not just a trigger to log which rows have been updated then when you run your replication batch you can easily copy the relavent data over (or delete where appropriate)

No comments:

Post a Comment