Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to set the column as identity column

Author  Topic 

pankaj2910
Starting Member

31 Posts

Posted - 2014-01-02 : 12:22:52
Customername Age IDN(identity)
ABS 23 1
RAM 43 5
RJD 32 7
ROHIY 54 8
AJAY 23 9

I need to set the IDN column as identity column with same existing value for current existing data in the table but when new data insert in next row the IDN column must be autogrowth with next append value.

Please suggest me the method or query to resolve this issue.

Currently I m working with SQL 2008

pankajrocks

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2014-01-02 : 12:25:27
you can directly alter a column to be of type identity
you need to do workaround like this
http://www.mssqltips.com/sqlservertip/1397/add-or-drop-identity-property-for-an-existing-sql-server-column/

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2014-01-02 : 13:00:30
quote:
Originally posted by visakh16

you can directly alter a column to be of type identity



cannot ?

Go to Top of Page
   

- Advertisement -