When the table's rows are changed, these changed rows are written to XML, and let me know that the table has been changed.
How can I do this?
When the table's rows are changed, these changed rows are written to XML, and let me know that the table has been changed.
How can I do this?
If you're looking for a strict TSQL or SQL Server solution:
UPDATE
, DELETE
and INSERT
functionality.UPDATE
, DELETE
and INSERT
to users2nd less attractive solution: You could also use triggers on the table to capture the UPDATE
, DELETE
and INSERT
activity. Strongly consider the stored proc solution over triggers.
If you can't alter how data is being changed in your table, the best solution would be to setup a trigger to capture changes in a separate table, and then write some code to periodically poll this table, and build your xml file.
Its worth noting that this will potentially slow down your db performance when editing data in this table (good for audit when users are making changes, bad for programatically changed data), and any errors coming from the trigger lead to quite misleading messages thrown back out of sql server.
See this question for some pointers on setting up the trigger.