They seem to be allowed as I can see both my insert triggers listed under the table with different names. Is it common or a bad practice? I am using SQL Server 2005
You can create multiple triggers for the same subject table, event, and activation time. The order in which those triggers are activated is the order in which the triggers were created. Db2 records the timestamp when each CREATE TRIGGER statement executes.
Oracle allows more than one trigger to be created for the same timing point, but it has never guaranteed the execution order of those triggers.
There is no limit. You can have as many triggers for the same event on a table.
There are 6 different types of triggers in MySQL: 1. Before Update Trigger: As the name implies, it is a trigger which enacts before an update is invoked.
Yes, you can definitely have more than one trigger for each operation, e.g. AFTER INSERT
or AFTER UPDATE
etc. It does make sense to split up separate concerns into separate, small, manageable chunks of code.
The one thing you cannot rely on is that they'll be executed in a certain order - the order in which the triggers are indeed executed also doesn't have to be stable, i.e. the same every time around.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With