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)
 SQL Alter Table Syntax

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-09-20 : 23:20:38
Arvind writes "Hi,
I'm new to SQL Server 2000,I'm facing problem in altering a table primary key.
My problem is I have a table called EMP and fields as
1) EMPID-->PK
2) EMPNAME

Need to convert this EMPID into identity column i.e an autonumber field start with 1 and increment by 1 without removing the old records in the EMP table.

I tried this
--------------------------------------------------------------
alter table emp alter column empid numeric(18,0) identity(1,1) not null
--------------------------------------------------------------
but it says
--------------------------------------------------------------
Incorrect syntax near the keyword 'identity'.
--------------------------------------------------------------
Thanks in Advance,
Arvind"
   

- Advertisement -