Can anyone help me to generate a repetitive sequential number using SQL Server 2008. Say I have a table of 1000 rows and a new field (int) added to the table. All I need is to auto fill that particular field with sequential numbers 1-100 all the way to the last row.
I have this but doesnt seem that it is working. You help is much appreciated.
DECLARE @id INT
SET @id = 0
while @id < 101
BEGIN
UPDATE Names SET id=@id
set @id=@id+1
END