Developing Managed Triggers

Managed triggers are static methods of a .NET class decorated with the SqlTrigger attribute. SqlTrigger has three named parameters:

EventA required string-valued parameter that tells SQL Server which type of trigger you’re defining, as is done when defining T-SQL triggers.

TargetA required string-valued parameter that tells SQL Server which schema and table you’re attaching the trigger to.

NameAn optional string parameter that tells the deployment routine what to call the trigger when it is created in the database.

The implementation contract for a managed trigger is only that it be a static method that returns void.

Inside the method body of a managed trigger, you need to get a reference to the execution ...

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.