|
For a particular column if both trigger and constraint are assigned. which one is going fire first and why?
(comments are locked)
|
|
My understanding is that the firing order is as follows:
http://msdn.microsoft.com/en-us/library/aa224775(SQL.80).aspx ya, its correct. Thank You Steinar.
Jan 12 '10 at 05:26 AM
Nani
You are welcome :-)
Jan 12 '10 at 06:05 AM
Steinar
(comments are locked)
|
|
You also asked for the reason. An INSTEAD OF trigger has to fire first since it completely replaces the operation. Then constraints are checked (since we now have all the new data in place). Finally, AFTER triggers fire. AFTER triggers are not part of the query plan for the original data modification - a new plan is created for them - so logically they must come last.
(comments are locked)
|

