INSTEAD OF triggers

  • Hi all!

    I'd like to manage the inserts of table A with a stored procedure, so I created an instead of trigger that cached the info inserted in the row, and then called an SP.

    This SP contains the insert instructions.

    But here is my paradox... these SP instructions will trigger the first trigger again recursively because of the insert statment (so the analizer fires an error)

    What can I do to insert in a row using a stored procedure that inserts in the table that fired the trigger?

    TKX in advance

  • hi

    check recursive triggers  database propertity is on .

    if it is ON turn off .

    You can see this in database properity option tab

    You can use sp_dboption to alter this property

    regards

    padmakumar

     

  • I had similar issues with triggers firing recursively. I added the following line at the begining of the trigger. It prevents the recursive behavior.

    IF (SELECT trigger_nestlevel()) > 1

    RETURN

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply