Partilhar via


ServerDdlTrigger Constructor (Server, String, ServerDdlTriggerEventSet, String)

Initializes a new instance of the ServerDdlTrigger class on the specified database with 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 _
)
public ServerDdlTrigger (
    Server parent,
    string name,
    ServerDdlTriggerEventSet events,
    string textBody
)
public:
ServerDdlTrigger (
    Server^ parent, 
    String^ name, 
    ServerDdlTriggerEventSet^ events, 
    String^ textBody
)
public ServerDdlTrigger (
    Server parent, 
    String name, 
    ServerDdlTriggerEventSet events, 
    String textBody
)
public function ServerDdlTrigger (
    parent : Server, 
    name : String, 
    events : ServerDdlTriggerEventSet, 
    textBody : String
)

Parameters

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

Remarks

This namespace, class, or member is supported only in version 2.0 of the Microsoft .NET Framework.

Example

How to: Create, Alter, and Remove a Trigger in Visual Basic .NET

Platforms

Development Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.

Target Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.

See Also

Reference

ServerDdlTrigger Class
ServerDdlTrigger Members
Microsoft.SqlServer.Management.Smo Namespace

Other Resources

Creating, Altering, and Removing Triggers
DDL Triggers
CREATE TRIGGER (Transact-SQL)