triggers and inserted table

  • in an "after insert" trigger im trying to make a cursor(i know its not wise and very slow, but its a must) for a select from INSERTED. I doesnt work, @@FETCH_STATE is always-1 after a fetch.

     

    i tried to make a table variable, insert into it all the values from inserted table and it works. the problem is that i need to make this trigger a fast one, and an aditional insert into a table variable will slow it down. am i doing something wrong with the insert table?

     

    and is there any way to temporary disable a trigger? i have some time taking procedures and i dont want to make them to start the trigger. i need it somehow disabled for the curent transaction. is there any way to do this?

  • No enough info.  Please post the code for your trigger.  There are some clever people on this site and the cursor may not be necessary after all.

    To disable a trigger, check out ALTER TABLE / DISABLE TRIGGER in BOL.

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

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

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