Define SQL Server Database Triggers
Use the SQL Server Database Trigger Editor to define the stored procedures that exist for a database in a SQL Server physical model.
You cannot use the SQL Server Database Trigger Editor until you have created a SQL Server database object in your model.
To define SQL Server database triggers
- Click Target - SQL Server, Databases on the Model menu.
The SQL Server Database Editor opens.
- Select the database from the Database drop-down that contains the database trigger that you want to define and then click the Trigger Editor button
on the toolbar.
The SQL Server Database Trigger Editor opens.
- Select the database trigger in the Navigation Grid that you want to define and work with the following options:
Click New
on the toolbar to create a new database trigger. Use the Enter filter text box to filter a very large list of database triggers to quickly locate the one that you want to define.
- Name
Displays the database trigger name. You can change the trigger name in this field.
- Trigger Timing
Specifies when the database trigger is executed. Make a selection from the drop-down list.
- Use Alter Syntax
Generates a combined CREATE and ALTER statement, which, during forward engineering:
- Creates a function if it does not exist.
- Alters a function if it exists.
Applicable SQL Server 2016 onward.
- Generate
Generates SQL during forward engineering. Clear the check box if you do not want to generate SQL.
- Click the General tab and work with the following options:
- Trigger Events
Specifies the database trigger events. If any of the selected events, or actions, occur in the database, the database trigger is executed. Select or clear the check boxes for the event groups and events that execute the database trigger.
- Type
Specifies the permission level in effect when the database trigger is executed.
- Select User
Specifies the user whose permissions are in effect for the execution of the database trigger.
This option is only available if you have selected the Execute As User option in the Type drop-down list.
- Enabled State
Specifies whether the database trigger is enabled or disabled.
- Encryption
Specifies that the database trigger is encrypted in the database.
- Click the Code tab to define the code type for the database trigger.
- Click the Expanded tab to view expanded code for the database trigger.
- (Optional) Click the Comment tab and enter any comments that you want to associate with the object.
- (Optional) Click the UDP tab to work with user-defined properties for the object.
- (Optional) Click the Notes tab to view and edit user notes.
- Click Close.
The database trigger is defined. The SQL Server Database Trigger Editor closes and you are returned to the SQL Server Database Editor.
- Click Close.
The SQL Server Database Editor closes.
Copyright © 2023 Quest Software, Inc. |