CLR Triggers

T-SQL triggers are really just stored procedures that are called by SQL Server at specific times and that can query values in the DELETED and INSERTED pseudo-tables (which expose “before and after” snapshots of data changed by the statement that fired the trigger). SQL CLR triggers are similar to SQL CLR stored procedures, and they can be created for all data manipulation language (DML) actions that modify data (that is, updates, inserts, and deletes).

SQL Server 2005 introduced the concept of data definition language (DDL) triggers, which can intercept and handle actions such as CREATE TABLE and ALTER PROCEDURE. Like DML triggers, DDL triggers can be implemented in T-SQL or SQL CLR code. We will cover both SQL CLR DML and DDL triggers ...

Get Programming Microsoft® SQL Server® 2012 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.