CLR Triggers

As it does with other types of routines, SQL Server 2005 allows you to use a .NET language of your choice to develop common language runtime (CLR) triggers. This capability is especially useful when you want your routines to perform activity for which T-SQL is weak at, such as complex calculations, procedural logic, or access to external resources. In this section, I will provide an example for a CLR trigger, though I have to say that I find the whole idea of developing triggers with CLR code moot.

As an example, you will be provided with a trigger that audits the data from inserted and deleted for DML triggers in the Microsoft Windows event application log. Auditing to the Windows event log gives you similar functionality as auditing ...

Get Inside Microsoft® SQL Server™ 2005 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.