O'Reilly logo

Programming Microsoft® SQL Server™ 2008 by Leonard Lobel, Andrew Brust, and Stephen Forte

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required