1 trigger multiple tables
Hi all,
I have a simple question. In my database I need to create triggers for serveral tables, all those triggers are exactle the same. So I wonder, is it possible to have 1 trigger which is triggerd by by different tables, or do I have to write that trigger multiple times.
Re: 1 trigger multiple tables
Triggers are based on the insert/update/delete of only the table they are linked to, therefore you'll need to have the code in a trigger on each table.
However, if the code really is identical, maybe you could put it in a stored proc and just call that from each trigger. You still have to put the call in each table trigger, but at least if you need to change the code you only need to do it in the proc?
Re: 1 trigger multiple tables
I was affraid of that, but I think I ask, just in case