I have an INSERT
trigger on table. When a row is inserted in table, the INSERT
trigger is fired.
The trigger's behaviour is such that it will insert another row into the same table.
What would be the result of the INSERT
statement?
Does this INSERT
result in an infinite loop, or just the expected 2 inserts开发者_如何学运维?
This is a setting in SQL- see the CREATE TRIGGER msdn page, specifically the section on Recursive Triggers. The setting you need to look into is RECURSIVE_TRIGGERS, if this is false, a trigger on Table1 will not trigger another insert into Table1. If you do allow recursive triggers, the limit is 32 levels deep.
精彩评论