Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Triggers 2

Status
Not open for further replies.

cass60660

Programmer
Nov 13, 2002
30
0
0
US
I need some help with this problem:
Can I create 2 triggers (FOR INSERT) on the same table ?
If yes, which one is going to fire first ?
One trigger (TR1) is validating the data and second trigger (TR2) is inserting in a log table the activity (in this case new rows).
If is possible to have 2 triggers (FOR INSERT) how can I establish the order ?

-I use: SQL Server 2000

Thank you.
 
I was thinking about that BUT the first trigger is returning to me (to the application) some warnings, messages and errors.
 
You can have multiple AFTER INSERT triggers on a table (but only one INSTEAD OF INSERT trigger).

You can set which triggers fire first and last using sp_settriggerorder. Any others will fire in an undefined order between them.

--James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top