SqlTriggerAttribute Constructor
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
.