Share via


ServerDdlTrigger Constructor (Server, String, ServerDdlTriggerEventSet, String)

Initializes a new instance of the ServerDdlTrigger class on the specified database that has the specified name. The trigger responds to the specified event set and runs the specified batch.

Namespace:  Microsoft.SqlServer.Management.Smo
Assembly:  Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)

Syntax

'Declaration
Public Sub New ( _
    parent As Server, _
    name As String, _
    events As ServerDdlTriggerEventSet, _
    textBody As String _
)
'Usage
Dim parent As Server 
Dim name As String 
Dim events As ServerDdlTriggerEventSet 
Dim textBody As String 

Dim instance As New ServerDdlTrigger(parent, _
    name, events, textBody)
public ServerDdlTrigger(
    Server parent,
    string name,
    ServerDdlTriggerEventSet events,
    string textBody
)
public:
ServerDdlTrigger(
    Server^ parent, 
    String^ name, 
    ServerDdlTriggerEventSet^ events, 
    String^ textBody
)
new : 
        parent:Server * 
        name:string * 
        events:ServerDdlTriggerEventSet * 
        textBody:string -> ServerDdlTrigger
public function ServerDdlTrigger(
    parent : Server, 
    name : String, 
    events : ServerDdlTriggerEventSet, 
    textBody : String
)

Parameters

  • name
    Type: System.String
    A String value that specifies the name of the server data definition language (DDL) trigger.
  • textBody
    Type: System.String
    A String value that specifies the Transact-SQL batch statement that runs when the trigger has been raised.

Examples

Creating, Altering, and Removing Triggers

See Also

Reference

ServerDdlTrigger Class

ServerDdlTrigger Overload

Microsoft.SqlServer.Management.Smo Namespace

Other Resources

DDL Triggers

CREATE TRIGGER (Transact-SQL)