SqlTriggerAttribute Class
Used to mark a method definition in an assembly as a trigger in SQL Server. The properties on the attribute reflect the physical attributes used when the type is registered with SQL Server. This class cannot be inherited.
Assembly: System.Data (in System.Data.dll)
The following example shows the SqlTriggerAttribute specifying the name of the trigger, the target table, and the event that will fire the trigger. See SqlTriggerContext for the full trigger example.
<SqlTrigger(Name:="SalesAudit", Target:="[dbo].[SalesInfo]", Event:="FOR INSERT")> _ Public Shared Sub SalesAudit() Dim triggContext As SqlTriggerContext ' Get the trigger context. triggContext = SqlContext.TriggerContext Select Case triggContext.TriggerAction Case TriggerAction.Insert ' Do something in response to the INSERT. End Select End Sub
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.