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 Alter an IDENTITY Column

Author  Topic 

amirmuthu
Starting Member

12 Posts

Posted - 2008-02-27 : 06:10:30
hello experts,

Any body know what is the query for modifying the identity column in a table? i mean modifying from IDENTITY column to int colum or VICE-VERSA

Thanks
Muthu


sakets_2000
Master Smack Fu Yak Hacker

1472 Posts

Posted - 2008-02-27 : 06:37:55
Why would you want to do that ?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-02-27 : 06:48:56
Is our requirement to insert explicit values to Identity column? If yes, you dont need to cahnge IDENTITY property for that. Just execute

SET IDENTITY_INSERT ON
before insertion step to allow explicit insertion of value and revert it after insertion using

SET IDENTITY_INSERT OFF
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-02-27 : 07:29:58
quote:
Originally posted by visakh16

Is our requirement to insert explicit values to Identity column? If yes, you dont need to cahnge IDENTITY property for that. Just execute

SET IDENTITY_INSERT Table_name ON
before insertion step to allow explicit insertion of value and revert it after insertion using

SET IDENTITY_INSERT Table_name OFF



Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -