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 2000 Forums
 SQL Server Development (2000)
 alter identity

Author  Topic 

fmardani
Constraint Violating Yak Guru

433 Posts

Posted - 2005-08-25 : 06:46:14
Hi,
What is the sql to drop the identity from a field.
I use this sql but the error is "Incorrect syntax near the keyword 'identity'."

alter table UM_TB_NOTE_HISTORY
alter column ID_NoteHistory int identity(1,1) not null

Thanks

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-08-25 : 07:17:28
Do you want to drop the identity property or add it to the existing column?

Madhivanan

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

fmardani
Constraint Violating Yak Guru

433 Posts

Posted - 2005-08-25 : 07:25:32
Hi,
stage 1: drop identity from the field
stage 2: add an identity to the field
Thanks
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-08-25 : 07:30:57
I think the only way is to do this from Enterprise Manager
Otherwise Create new table with identity and other fields and copy the data from old table and drop old table and rename new table

Madhivanan

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

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2005-08-25 : 10:03:53
"set identity_insert dbo.tablename on" will disable the identity property....if this is enough to satisfy the IT objective.
Go to Top of Page
   

- Advertisement -