declare @i int set @i = 0 while @i < 100 begin update table set column = @i where ID_column = @i set @i = @i + 1 end