regarding stored procedure looping

  • hi, i have some problems with my stored procedure. i have 3 stored procedures, SP1, SP2, SP3. in SP1, i have a cursor that first exec SP2 (SP2 will output variable var1), after which var1 will be passed into SP2 as paprameter.

    in SP2, var1 is used for calculation to get var2, e.g. var2=var1*1000, after which var2 is inserted as a new row, together with some other values, into table T1. but when i checked T1, it seemed like var2 does not change, maeaning that var1 entered into table is always the same value. anyonw has any suggestions as to where i may go wrong?

    thanks

  • Hard to tell without you posting the actual code. Where does SP3 come into play?

    Have you tried a series of PRINT, SELECT or RAISERROR...NOWAIT statements to track values of variables during execution?


    Cheers,
    - Mark

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

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