Delen via


SqlTriggerAttribute Constructor

Definition

An attribute on a method definition in an assembly, used to mark the method as a trigger in SQL Server.

public:
 SqlTriggerAttribute();
public SqlTriggerAttribute ();
Public Sub New ()

Examples

public partial class Triggers
{
    [SqlTrigger(Target="authors", Event="FOR UPDATE")]
    public static void AuthorsUpdateTrigger()
    {
        //...
    }
}
Partial Public Class Triggers

    <SqlTrigger(Target:="authors", Event:="FOR UPDATE")>
    Public Shared Sub AuthorsUpdateTrigger()

        '...
    End Sub
End Class

Remarks

The following example specifies that the trigger is activated by updating existing data (UPDATE) in the table authors.

Applies to