Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can triggers and stored procedures be represented in an ER Diagram?

Is it a good idea to show triggers and stored procedures in an Entity Relationship Diagram? If yes, what is the notation? Information seems really scarce on this topic. Also, are there any UML diagrams you would use to represent triggers?

like image 806
David Avatar asked Apr 14 '13 12:04

David


2 Answers

Since Triggers are based on actions in sequence, I haved used a UML sequence diagram rather than an ERD. The swimlanes would be the base tables and the messages would be the triggers firing. For stored procedures, the same approach could be taken if the stored procedures were centered around a certain table. If not, a collaboration diagram could be used.

like image 140
Steve Michalski Avatar answered Sep 18 '22 06:09

Steve Michalski


As Steve said, you may represent the dynamic of a trigger or stored proc in a dynamic diagram. But for triggers specifically, if you just want to declare them, you can also add them as operations in classes used to represent the corresponding tables in your Entity Relationship Diagram. In this case, you might want to use relevant stereotypes on these operations, such as <<trigger>>.

like image 29
Steph Avatar answered Sep 21 '22 06:09

Steph