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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Remove the IDENTITY for a column in a table.

Author  Topic 

ganeshkumar08
Posting Yak Master

187 Posts

Posted - 2009-07-30 : 07:32:34
Hi all

Can any one help me in removing IDENTITY property of a column.

I have table a below structure.

Create table Temp(EmpID Int Identity(1,1),Name Varchar(50))

Now my problem is to remove the identity for EmpID column.


Thanks
Ganesh

Solutions are easy. Understanding the problem, now, that's the hard part

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2009-07-30 : 07:44:57
For Remove:

ALTER TABLE tablename ALTER COLUMN column_b INT

For Disabling Identity insert:

SET IDENTITY_INSERT <Table_Name> ON


For enabling Identity insert:

SET IDENTITY_INSERT <Table_Name> OFF


Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled

http://senthilnagore.blogspot.com/
Go to Top of Page

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-07-30 : 07:54:09
u can disable the identity property in design mode
Go to Top of Page

NeilG
Aged Yak Warrior

530 Posts

Posted - 2009-07-30 : 10:53:15
....
Go to Top of Page

NeilG
Aged Yak Warrior

530 Posts

Posted - 2009-07-30 : 10:57:26
quote:
Originally posted by senthil_nagore

For Remove:

ALTER TABLE tablename ALTER COLUMN column_b INT




Thats all I can see you needing to me
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-08-05 : 05:55:37
<<
ALTER TABLE tablename ALTER COLUMN column_b INT
>>

Still identity will be part of a column


Madhivanan

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

- Advertisement -