right now, i have a table and some triggers created by someone else, i don't know that execution order of those triggers(maybe someone set the order, maybe not, i don't know),
Please check below query, if is_first and is_last is zero, and they have same type_desc, triggers execution orderd by modify date.
select sys.tables.name,sys.triggers.name,sys.trigger_events.type
,sys.trigger_events.type_desc, is_first,is_last
,sys.triggers.create_date,sys.triggers.modify_date
from sys.triggers inner join sys.trigger_events
on sys.trigger_events.object_id = sys.triggers.object_id
inner join sys.tables on sys.tables.object_id = sys.triggers.parent_id
order by modify_date
Thanks.
Please mark the replies as answers if they help or unmark if not.
Feedback to us
GoChinaGo
Member
46 Points
75 Posts
how to find out triggers execution order?
Apr 20, 2012 05:56 PM|LINK
any idea?
thanks
pradeep22988
Member
14 Points
5 Posts
Re: how to find out triggers execution order?
Apr 20, 2012 07:02 PM|LINK
It is depend upon you where u set the trigger and start the trigger
thanks
GoChinaGo
Member
46 Points
75 Posts
Re: how to find out triggers execution order?
Apr 20, 2012 07:08 PM|LINK
that's the things i want to find out,
right now, i have a table and some triggers created by someone else, i don't know that execution order of those triggers(maybe someone set the order, maybe not, i don't know),
is there a way to find out the order....
Huske
Contributor
4060 Points
756 Posts
Re: how to find out triggers execution order?
Apr 20, 2012 07:10 PM|LINK
Check this article out http://www.mssqltips.com/sqlservertip/1409/forcing-trigger-firing-order-in-sql-server/
GoChinaGo
Member
46 Points
75 Posts
Re: how to find out triggers execution order?
Apr 20, 2012 07:30 PM|LINK
thanks for the reply, i saw that post as well,
i don't want to set the order, all i want is to see what the current execution order is for those triggers
thanks.
jayeshgoyani
Contributor
2394 Points
424 Posts
Re: how to find out triggers execution order?
Apr 21, 2012 04:39 AM|LINK
you can trace this(all excucation of any DB) by using "SQL Server Profiler".
MCP
My Blog
GoChinaGo
Member
46 Points
75 Posts
Re: how to find out triggers execution order?
Apr 23, 2012 04:48 PM|LINK
can you be more specific?
Chen Yu - MS...
All-Star
21584 Points
2493 Posts
Microsoft
Re: how to find out triggers execution order?
Apr 24, 2012 10:51 AM|LINK
Hi,
Please check below query, if is_first and is_last is zero, and they have same type_desc, triggers execution orderd by modify date.
Thanks.
Feedback to us
Develop and promote your apps in Windows Store