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
Use This :
For example :
USE AdventureWorks;
GO
EXEC sys.sp_settriggerorder @triggername = N'', -- nvarchar(517)
@order = '', -- varchar(10)
@stmttype = '', -- varchar(50)
@namespace = '' -- varchar(10)
The First and Last triggers must be two different triggers.
First : Trigger is fired first.
Last : Trigger is fired last.
None : Trigger is fired in undefined order.
And see this link for value of @stmttype : DDL Events
And for @namespace = { 'DATABASE' | 'SERVER' | NULL } and for more information see : DDL Triggers