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
 Transact-SQL (2000)
 Alter table column to include identity

Author  Topic 

ivacacela
Starting Member

10 Posts

Posted - 2006-12-20 : 08:45:16
Hi,

Please I like to know the SQL command to alter a table to change a column to support Identity (Autoincrement).

Thanks in advance.

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-12-20 : 08:57:15

1 You cant alter existing column to have identity property
2 Do this in Enterprise Manager

Madhivanan

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

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-12-20 : 09:03:15
or

Alter Table Table1
drop column col1

Alter Table Table1
add col1 int identity(1,1)


Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

ivacacela
Starting Member

10 Posts

Posted - 2006-12-20 : 15:17:34
Thanks for your support, it solves 100% my question.

Thanks again to both of you.

Ivan
Go to Top of Page
   

- Advertisement -