
- Forum
- Databases
- SQL Server - how to alter normal column to identitycolumn
-
Junior Member
Re: how to alter normal column to identitycolumn
There is no way to modify the identity property of a column through scripts.
You can try doing it from enterprise manager and generate the change scripts it follows the steps as below
- create a tmp table with same design
- transfer data to the tmp table from original table
- drop the original table
- create with new specs and
- retransfer data with identity of
- switch on the identity
however do ensure that the column you want to change to identity has no nullls and duplicates
Regards
AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules