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 too can be created for all data manipulation language (DML) actions (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. (DDL triggers are covered in Chapter 2.) Like DML triggers, DDL triggers can be implemented in T-SQL or SQL CLR code. We will cover both SQL CLR ...
Get Programming Microsoft® SQL Server™ 2008 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.