Modeling Triggers in ERD

A database trigger is a procedure that is automatically executed in response to certain events on a database table. A common use of database trigger is for auditing database. A trigger that records the insertion, modification and deletion of important data will let you know when and why certain change has been made to the database.

Creating a Trigger

  1. Select Triggers from diagram toolbar.
    Select Triggers
    Select Triggers
  2. Click on the ERD to create a triggers shape. Note again that this is a container of triggers, not the trigger itself.
  3. Enter its name.
    Triggers created
    Triggers created
  4. To create a trigger, right click on the triggers shape and select New Trigger from the popup menu.
  5. Enter the physical name of the trigger.
    Trigger added
    Trigger added
  6. Right click on the trigger and select Open Specification... from the popup menu.
  7. Enter the Create statement of trigger. The create statement entered here will be executed in database generation, so make sure it's in correct syntax.
    Create statement of trigger
    Create statement of trigger

Moving or duplicating a trigger to another trigger container

  1. Select the trigger to move or duplicate.
    Select triggers to move or duplicate
    Select triggers to move or duplicate
  2. Drag over the target trigger container.
    Drag trigger towards the target triggers container
    Drag trigger towards the target triggers container
  3. If you want to duplicate the triggers, press on the Ctrl key and release the mouse button. If you want to move them from source to target trigger container, just release the mouse button.
    Triggers are moved
    Triggers are moved

Related Resources

The following resources may help you to learn more about the topic discussed in this page.

 
9. Modeling Stored Procedures in ERD Table of Contents 11. Working with Unique Constraint

We use cookies to offer you a better experience. By visiting our website, you agree to the use of cookies as described in our Cookie Policy.OK