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)
 INSERT

Author  Topic 

supersql
Yak Posting Veteran

99 Posts

Posted - 2006-03-13 : 13:40:04
I am trying to insert 3500 rows from table budget04 to budget05. I have an IDENTITY field in budget05 where there is no chance of inserting duplicate key but still I get this error message

Server: Msg 2627, Level 14, State 2, Line 1
Violation of UNIQUE KEY constraint 'IX_budget05. Cannot insert duplicate key in object budget05.
The statement has been terminated.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-03-13 : 13:44:46
What columns are in your unique constraint? Can you post the DDL for both tables including indexes and constraints?

Tara Kizer
aka tduggan
Go to Top of Page

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2006-03-13 : 17:15:30
supersql,

U should not have the Identity column in ur Source or Destination when inserting
eg
Insert into Dest (<fields except Identity>)
Select <fields except Identity> from Source
Go to Top of Page
   

- Advertisement -