Server Triggers Wizard (SQL Server)

From RapidSQL
Jump to: navigation, search

Go Up to Microsoft SQL Server Object Wizards

This wizard builds and submits a CREATE TRIGGER... ON ALL SERVER statement, letting you create a DDL trigger with server scope, that fires in response to either a logon or selected DDL events. The wizard builds basic syntax only, letting you provide the actions and conditions SQL making up the main body of the trigger.

Note: Before working with server triggers, consult Microsoft SQL Server documentation for general information on DDL triggers as well as specifics such as FOR/AFTER argument details, valid actions and conditions, and supported events. For more information, see Accessing Third Party Documentation.

To create a new server trigger using a wizard:

  1. Open an object creation wizard for a server trigger. For details, see Opening an Object Wizard.
  2. Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:
  3. Finally, use the Execute button to create the object.
    Note: In order to fire in response to logons or specified events, a server trigger must be enabled. For information on enabling and disabling a server trigger, see Server Triggers Editor (SQL Server) and Change Status (SQL Server DDL triggers).

Server Triggers (SQL Server) - Properties

When creating or editing a server trigger, this tab/panel lets you work with the following settings:

Setting Description

Name

Provide a name for the DDL trigger.

Trigger Timing

Use this control to specify a FOR/AFTER argument option. If the Fire On Logon check box is not selected, the specific events for the argument are provided on the Trigger Events tab/panel.

Fire On Logon

If selected, the CREATE TRIGGER statement is created with a FOR/AFTER LOGON argument, associating the DDL trigger with a user logon. If deselected, the trigger is associated with the event(s) selected on the Trigger Events tab/panel.

Encrypted

Select this check box to add a WITH ENCRYPTION argument to the generated DDL. This prevents the trigger from being published as part of a SQL Server replication.

Server Triggers (SQL Server) - Trigger Events

When creating or editing a database trigger, this tab/panel lets you select the FOR/AFTER argument DDL events that will fire this trigger.

Note: This tab/panel is only available if the Fire On Logon check box is deselected. For more information, see Server Triggers (SQL Server) - Properties.