
- Forum
- Databases
- SQL Server - how to alter normal column to identitycolumn
-
Junior Member
how to alter normal column to identitycolumn
I have existing table it has two columns one column datatyps is int
i want to alter that int column to identity colum
now i have datain that table
how this is possible to alter to identity column
-
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
-
Junior Member
Re: how to alter normal column to identitycolumn
just u go to the SqlEnterprisemanager-> and select the Database and one of the table(Ex:EmployeeTabel) select and modify u select the one colum and regradeing columns Details Populated in the footer and selected (select Deptno Column) and set one of option is Seed and give some number that's why we can change the exsting column constraint
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