O'Reilly logo

Microsoft® SQL Server 2008 R2 Unleashed by Alex T. Silverstein, Chris Gallelli, Paul Bertucci, Ray Rankins

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

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

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