Trigger not firing for all records in a cursor

  •  

    Hi,

    I have a procedure that opens a cursor for rows in a table say tableA and updates each record one by one, it sets a single column's value to itself. The tableA has an AFTER UPDATE trigger that performs a perticular task whenever a row is updated. I've noticed that it is often missed, i.e. not called. Like I have inserted some test values into a temporary table before the update statement in the procedure, and inside the trigger code, and after the update statement. can somebudy suggest me anything  about why is the trigger get missed for some updates to the table rows... like for rows 1,2,3,4,5 the trigger is fired for 1,2,3,4 but not 5.

    take care

    Rehan Ahmad

    - Rattu

  • The AFTER UPDATE trigger intercepts triggering action and does something based on the logic that is in it. Probably that may not satisfy the condition written inside the trigger. Check your code. Only after evaluating the conditon it fires.

     

     


    Helen
    --------------------------------
    Are you a born again. He is Jehova Jirah unto me

  • Helen's suggestion sounds like what might be happening.

  • Hey guys thanks for your help... the problem is identified and solved ... it was an exception in the code of the trigger that occurs only for the last row ... btw it took me too long ... can you please tell me how to debug T-SQL code just like we debug C code in Visual Studio enviroment.

    anyways thanks.

    Regards

    - Rattu

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

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