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 2008 Forums
 Other SQL Server 2008 Topics
 Very Urgent : ms sql server 2000 query1

Author  Topic 

biz
Starting Member

4 Posts

Posted - 2008-12-02 : 03:38:42
i have a query in ms-sql server2000
can we convert ID numeric(18,0) to identity(1,1) which will be primary key ,
since this ID numeric(18,0) is a foreign key in another table so i wanted that this key should be as primary auto incrementing key

whereas i am also unable to do insert into statement for the same
error ocuuring is as : Cannot insert explicit value for identity column in table

Can you please help me out.

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2008-12-02 : 03:58:14
An identity is a column that gets automatically assigned. You don't insert into it. If you want to specify values for the PK, remove the identity property from the column.

--
Gail Shaw
SQL Server MVP
Go to Top of Page
   

- Advertisement -