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

  • 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.