Wesley
Wesley

Reputation: 412

How do I update my primary key in MySQL?

Ok, this is probably really simple, but I just can't figure it out. I have a primary key in a table that goes from 1-5,000. I need to manually update that id (for other table update purposes) so that it says 5,000-10,000. Can't I manually update this column? Please help!!! Thank you

Upvotes: 1

Views: 524

Answers (1)

Amy B
Amy B

Reputation: 110111

SET IDENTITY_INSERT tableName ON

UPDATE tableName
SET columnName = columnName + 5000

SET IDENTITY_INSERT tableName OFF

Upvotes: 3

Related Questions