Using DML Triggers

DML triggers are invoked when a DML event occurs in the database. DML events manipulate or modify the data in a table or view. These events include insertions, updates, and deletions.

DML triggers are powerful objects for maintaining database integrity and consistency. They are able to evaluate data before it has been committed to the database. During this evaluation period, these triggers can perform a myriad of actions, including the following:

• Compare before and after versions of data.

• Roll back invalid modifications.

• Read from other tables, including those in other databases.

• Modify other tables, including those in other databases.

• Execute local and remote stored procedures.

Based on the nature of these actions, ...

Get Microsoft® SQL Server 2008 R2 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.