Forum Replies Created

Viewing post 1 (of 1 total)

  • RE: Tran + While Loop Help (running last row twice?!)

    Instead of

    WHILE @currentRow IS NOT NULL

    Try

    WHILE EXSITS (SELECT * FROM #Pending WHERE row_id > @currentRow)

    Currently, let's say you're on the last record. The statement

    SET @currentRow = (SELECT MIN(row_id) FROM...

Viewing post 1 (of 1 total)