In order to do that there must be something in your table that uniquely identifies a row. If there is no way to distinguish one row that has a [Series] = 234 from a different row that has [Series]=234 then you have do something like this:alter table yourTable add i int identity(1,1)goupdate t set t.lineNumber = d.lineNumberfrom ( select i ,Series , row_number() over (partition by series order by lineNumber) as LineNumber from yourTable ) dinner join yourTable t on t.i = d.igoalter table #yourTable drop column i
EDIT:fixed syntax errorBe One with the OptimizerTG