Previous Topic: Define SQL Server Table TriggersNext Topic: Define SQL Server View Column Properties


Define SQL Server View Triggers

Use the SQL Server View Trigger Editor to define the stored procedures that exist for a view in a SQL Server 2005 or 2008 physical model.

To define SQL Server view triggers

  1. Right-click a view trigger in the Model Explorer and click Properties.

    The SQL Server View Trigger Editor opens.

  2. Select the view from the View drop-down that contains the view trigger that you want to define.
  3. Select the view trigger in the Navigation Grid that you want to define and work with the following options:

    Note: Click New New icon in property editors to create a new object on the toolbar to create a new view trigger. Use the Enter filter text box to filter a very large list of view triggers to quickly locate the one that you want to define.

    Name

    Displays the view trigger name. You can change the trigger name in this field.

    Schema

    Specifies the schema for the view trigger. Select a schema from the drop-down list or click the New icon to open the SQL Server Schema Editor and create one.

    Insert

    Specifies to execute the view trigger on INSERT.

    Update

    Specifies to execute the view trigger on UPDATE.

    Delete

    Specifies to execute the view trigger on DELETE.

    Trigger Timing

    Specifies when the view trigger is executed.

    Generate

    Generates SQL during forward engineering. Clear the check box if you do not want to generate SQL.

  4. Click the General tab and work with the following options:
    Encryption Enabled

    Specifies that the view trigger is encrypted in the database.

    Not for replication

    Specifies that the view trigger is not invoked as part of database replication.

    Enabled State

    Specifies whether the view trigger is enabled or disabled.

    Type

    Specifies the permission level in effect when the view trigger is executed.

    Select User

    Specifies the user whose permissions are in effect for the execution of the view trigger.

    Note: This option is only available if you have selected the Execute As User option in the Type drop-down list.

  5. Click the Code tab to define the code type for the view trigger.
  6. Click the Expanded tab to view expanded code for the view trigger.
  7. (Optional) Click the Comment tab and enter any comments that you want to associate with the view trigger.
  8. (Optional) Click the UDP tab to work with user-defined properties for the view trigger.
  9. (Optional) Click the Notes tab to view history associated with the view trigger and to add or view user notes.
  10. Click Close.

    The view trigger is defined and the SQL Server View Trigger Editor closes.

More information:

SQL Server Property Editors

Define the Code Type for an Object in a SQL Server Property Editor

View Expanded Code in a Property Editor

Add a Comment in a Property Editor

Add a UDP in a SQL Server Physical Property Editor