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
- Select Triggers from diagram toolbar.
Select Triggers - Click on the ERD to create a triggers shape. Note again that this is a container of triggers, not the trigger itself.
- Enter its name.
Triggers created - To create a trigger, right click on the triggers shape and select New Trigger from the popup menu.
- Enter the physical name of the trigger.
Trigger added - Right click on the trigger and select Open Specification... from the popup menu.
- 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
Moving or duplicating a trigger to another trigger container
- Select the trigger to move or duplicate.
Select triggers to move or duplicate - Drag over the target trigger container.
Drag trigger towards the target triggers container - 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
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 |