SQL Server triggers - order of execution

前端 未结 10 1193
旧时难觅i
旧时难觅i 2020-12-16 09:39

Does anyone know how SQL Server determines the order triggers (of same type, i.e. before triggers) are executed. And is there any way of changing this so that I can specify

10条回答
  •  爱一瞬间的悲伤
    2020-12-16 10:25

    If you're at the point of worrying about trigger orders then you really should take a step backwards and consider what you are trying to do and if there is there a better way of doing it. The fact that this isn't an easy thing to change should be telling you something.

    Triggers always look like a really neat solution, and in the right place they are highly valuable, but the price is high, and it's really easy to create debugging nightmares with them. I've lost many hours in the past trying to debug some obscure database behavior only to find that the cause is burrowed away in an overlooked trigger.

提交回复
热议问题