Forum Discussion
mesan98
Mar 25, 2021Copper Contributor
Alter a primary key column as IDENTITY
Hi there,
I have a SQL Server table named Users (ID, Name, LoginDate, Password, Email) with some records in it. But when I created it I forgot to Auto Increment its ID which is the primary key. Now I am trying to alter the ID column to turn in into an IDENTITY or AUTO-INCREMENT attribute but I failed.. Is there a way I can do that plz ?
Thanks in advance !
- olafhelperBronze Contributor
mesan98, you can not alter an existing column to IDENTITY.
You have to either recreate the table or add an additional column with IDENTITY property.
Olaf