Home Forums SQL Server 2008 T-SQL (SS2K8) Repopulating a sequenced column that has gone out of sequence. RE: Repopulating a sequenced column that has gone out of sequence.

  • This is all you needed:

    With cte As

    (

    select IntSequence, ROW_NUMBER() OVER (order by externalsequence asc) as rownumber from labels

    )

    update cte

    set IntSequence = rownumber;