Home Forums SQL Server 7,2000 T-SQL Please give me a replacement for a Cursor RE: Please give me a replacement for a Cursor
Jesper-244176
SSCertifiable
Points: 7082
More actions
July 7, 2005 at 6:56 am
#571738
If there is a unique id, then it is easy:
while (@id is not null)
select @id = min(id) from table where id > @id
and continue until you get null.