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)
 Setting IDENTITY property of an SQL Server Column

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-04-17 : 09:34:49
steve writes "Does anyone know the correct SQL syntax for changing an existing column to an identity column.

ie rather than
CREATE TABLE Yaks ( YakID smallint identity(7,2), YakName char(20) )


what would be the "Alter Table myTable Alter Column myColumn" SQL equivalent?

I intend to run the SQL against existing tables using VB6 & ADO.


Thanks

Steve"

VyasKN
SQL Server MVP & SQLTeam MVY

313 Posts

Posted - 2002-04-17 : 09:37:34
Not possible from script. Do it in Enterprise Manager, if the table is not too huge. For more info: http://www.tsqlsolutions.com/Articles/Index.cfm?ArticleID=22080

--
HTH,
Vyas
Check out my SQL Server site @
http://vyaskn.tripod.com
Go to Top of Page

stever
Starting Member

1 Post

Posted - 2002-04-17 : 21:37:29
thanks,

dropping/adding column worked fine.

Go to Top of Page
   

- Advertisement -