Odd Occurance with Stored Procs

  • I have a SP that gets the first row with a NULL date, then calls another SP (within the first SP) that updates that row with the current date, then returna the value.

     

    The odd thing happened the other night....the SP returned the same value from two different calls, within 15-20 seconds of each call. It only happened once, but I would like to know what circumstances could make that occur, and is there anything I can do to prevent it from ever happening?

     

    Thanks

    Michael

  • May I first ask the reason why you are not updating all rows in a single batch?

  • The table holds ID numbers for items. These numbers are issued by the state and have legal ties to them. When a user initiates a new item, it goes out and pulls a number from the table...and does the steps I outlined above.

  • It does not explain why you need RBAR operation.

    INSERT INTO Item

    (LegalNumber, Col list)

    SELECT N.LegalNumber, ColumnsList

    FROM DataSourse S

    INNER JOIN LegalNumbers N ON S.SomeID = N.SomeID

    _____________
    Code for TallyGenerator

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

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