Previous Topic: SQL Azure TriggersNext Topic: Define SQL Azure Table Triggers


Define SQL Azure Database Triggers

Use the SQL Azure Database Trigger Editor to define the triggers that exist for a database in a SQL Azure physical model.

Note: You cannot use the SQL Azure Database Trigger Editor until you have created a SQL Azure database object in your model.

To define SQL Azure database triggers

  1. Click Target - SQL Azure, Databases on the Model menu.

    The SQL Azure Database Editor opens.

  2. 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 Trigger Editor Button in SQL Server Database Editor Toolbar on the toolbar.

    The SQL Azure Database Trigger Editor opens.

  3. Select the database 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 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.

    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:
    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.

    Note: 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.

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

    The database trigger is defined and the SQL Azure Database Trigger Editor closes and you are returned to the SQL Azure Database Editor.

  11. Click Close.

    The SQL Azure Database Editor closes.

More information:

SQL Azure Property Editors

Define the SQL Code for an Object in a SQL Azure Property Editor

View Expanded Code in a Property Editor

Add a Comment in a Property Editor

Add a UDP in a Physical Property Editor