Viewing post 1 (of 1 total)
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...
November 22, 2004 at 5:56 pm
#531153