Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
j-in-nz
Starting Member
17 Posts |
Posted - 2007-04-02 : 18:52:03
|
| I have 3 tableson update of SETUP table I execute a trigger to update a field in TABLE1 where TABLE2.field = something. The problem is that TABLE1 has a trigger to update TABLE2. So the value is getting set before the 1st trigger is executed.How can I set the order of the triggers? |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-04-02 : 19:03:32
|
If you are using AFTER trigger, the trigger is executed AFTER the insert or update. use INSTEAD OF TRIGGER ?or drop all trigger and perform the necessary updates in the sequence that you want with Stored Procedure. KH |
 |
|
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2007-04-02 : 19:16:47
|
| I''m not sure if this will solve your issue, but you might take a look at: sp_settriggerorder in BOL. |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-04-02 : 19:22:37
|
sp_settriggerorder is for a table. What j-in-nz have is different table.quote: sp_settriggerorderSpecifies which AFTER triggers associated with a table will be fired first or last. The AFTER triggers that will be fired between the first and last triggers will be executed in undefined order.
KH |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
|
|
|