UPDATE IDENTITY KEY values

  • Hi masters,

    I need to update some values of an identity column.

    How can i do this in SQL Server 2000?

    Tks,

    Pedro

  • You can't UPDATE identity column using update command, but u can reseed the value using DBCC CHECKIDENT.

  • But in this case , i really need it.

    I have to update several values of a column that as an identity key.

    Can i drop the identity key, make the updates to the data and then recreate the identity column?

  • Is this ur Live or Test Database?

  • It's my real database.

    I will send a script

  • You cannot update an identity column. If you absolutely need to change some values, delete the row and then reinsert it specifying the identity value (with identity insert on)

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Why do you need to update values?

    Perhaps we have another solution for you.

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply