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.

  • Perfect! Thanks so much.

    I was on to something a tiny bit similar myself, but for some reason my code doesn't change the data at all.

    declare @id bigint

    set @id = 0;

    With cte As

    (

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

    )

    update cte

    set @id = IntSequence = @id + 1

    That's a big help. Thanks again.