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)
 IDENTIY to existing column without use Ent Manager

Author  Topic 

SqlStar
Posting Yak Master

121 Posts

Posted - 2003-11-13 : 09:13:42
Hi,

I have an integer column in a table without IDENTITY property. Now I want to add this property to that column without using Enterprise Manager. Using syntax oriented like:

ALTER TABLE <tab name> ALTER COLUMN <col> <datatype> IDENTITY(1,1)

I have tried like this, but sql serevr says error like "Incorrect syntax near the keyword 'IDENTITY'". Its an urgent requirement. send me your reply ASAP.

Note: That column data is unique.

Thanks,


":-) IT Knowledge is power :-)"

":-) IT Knowledge is power :-)"

Stoad
Freaky Yak Linguist

1983 Posts

Posted - 2003-11-13 : 09:40:04
Impossible. Only drop & re-create the table
(just like as EM do it in this case).
Go to Top of Page

AjarnMark
SQL Slashing Gunting Master

3246 Posts

Posted - 2003-11-13 : 13:18:34
Duplicate Post. See [url]http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=30549[/url] for a more detailed version of the same answer.

--------------------------------------------------------
Visit the SQLTeam Weblogs at [url]http://weblogs.sqlteam.com[/url]
Go to Top of Page
   

- Advertisement -