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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-04-25 : 12:22:32
|
| Monys writes "I´ve got a trigger (Sql server 2000) who does not fire complete, it has two updates in different tables, it works in the first table, but when it go to the second update, it doesn´t fire.The mistake that appears when it tries to execute the second update is the following:Maximun stored procedure resting level exceed (limit 32)And the trigger is like this:create trigger active on movs for updateasdeclare @a integerdeclare @b smallintdeclare @c integerdeclare @d smallintselect @a=a from insertedselect @b=b from insertedselect @c=c from id_mov from insertedselect @d=d from t_m where id_tm=@cif (@mov=102)begin update idc set sa=sa+((select m from inserted)*d)where a=@a and b=@b update movs set s=(select sa from edc where a=@a and b=@b) where cont=(select cont from inserted)end" |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2002-04-25 : 12:40:48
|
| when you update movs, it causes the trigger to fire again . . . its like writing a stored procedure that calls itself. This is called nesting. Books on Line has a good section on this.<O> |
 |
|
|
|
|
|