Problem with nested triggers

  • Hello,

     I have a trigger on a currenty rate table which in turn updates two additional tables (orders_dealer and orders_web). Those two additional tables also have triggers. It appears that the first table trigger is firing, however the second table trigger it not.

     Here's the initial trigger:

    ALTER trigger [tr_fxo_ccy] on FXO_CCY

    After Update, Insert

    As

    ...  /* Declaration section */

     declare fxo_ccy cursor for

     select pkey

     from inserted

     open fxo_ccy

     fetch next from fxo_ccy INTO @ref_pkey

     while @@FETCH_STATUS = 0

         begin     

           select  @cur_1  = cur_1, /* Here we select from the table just updated */

             @cur_2       = cur_2,

             @lst_rate   = lst_rate,

             @lst_bid    = lst_bid ,

             @lst_ask    = lst_ask ,

             @rate_high  = rate_high,

           from fxo_ccy where pkey = @ref_pkey

    -- Update the orders_dealer table

    exec fxo_ccy_update_monarque @cur_1, @cur_2, @lst_rate ,@lst_bid , @lst_ask 

                         

      -- Update the orders_web table

     exec fxo_ccy_update_web @cur_1, @cur_2 ,@lst_rate ,@lst_bid , @lst_ask

         fetch next from fxo_ccy INTO @ref_pkey

      end

      close fxo_ccy

      deallocate fxo_ccy

    -----

    The first procedure call to "fxo_ccy_update_monarque" updates the Order_Dealer table and the trigger fires.

    The second proc call "fxo_ccy_update_web " updates the Orders_Web table, however the trigger on Orders_Web is NOT firing.

    If I run EXEC sp_configure 'nested triggers', it shows run_value=1 and maximum=1. Do I need to change the max nested triggers value ?

    Thank you,

    Bob

     

  • Folks,

     We found the problem. We had logic to RETURN in the event of a NEW ORDER. So we are okay now.

    Thank you,

    Bob

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

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