Let\'s say I have table TabA with columns:
col1 - primary key (but not identity)
col2 - foreign key
col3 -
General order of execution for INSERT, UPDATE, DELETE statements:
sp_settriggerorder
, execute those at the appropriate point, with any remaining triggers executed in undefined order.You may have only 1 INSTEAD OF trigger (per action: INSERT, UPDATE or DELETE). That trigger will always get executed before any AFTER triggers, since it executes in lieue of the corresponding INSERT, UPDATE or DELETE statement.
AFTER triggers are always executed, oddly enough, AFTER the data modification statement executes.
NOTE: If you have an INSTEAD OF trigger, it is unclear to me, not having spent any real amount of time fussing with INSTEAD OF triggers, whether or not table/row constraints are enforced prior to execution of the INSTEAD OF trigger. That's something you might want to experiment with.