Can I have two different triggers in the same table?

They seem to be allowed since I see both insert triggers listed in the table with different names. Is this a common or bad practice? I am using SQL Server 2005

+7
source share
2 answers

Yes, you can definitely have more than one trigger for each operation, for example. AFTER INSERT or AFTER UPDATE etc. It makes sense to separate individual problems into small, manageable pieces of code.

The only thing you cannot rely on is that they will be executed in a certain order - the order in which triggers are actually executed also does not have to be stable, that is, the same every time.

+11
source

this is good practice because then you can break your changes over time into small (flexible) pieces and add or remove them independently of each other.

+2
source

All Articles