Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

False duplicate key error

Status
Not open for further replies.
May 21, 2001
52
US
I am inserting records from a temp table (PS_PROJ_RES_TMP) to a main table (PS_PROJ_RESOURCE) in MS SQL Server 2000. I am consistantly getting the message:

The insert failed:
Server: Msg 2601, Level 14, State 3, Line 1
Cannot insert duplicate key row in object 'PS_PROJ_RESOURCE' with unique index 'PS_PROJ_RESOURCE'.
The statement has been terminated.

I cannot find any duplicate keys in the temp table corresponding to the main table. Both tables have the same fields. The temp table is used by our software to perform calculations on the data before it is inserted to the main table. What would trigger the duplicate key error other than a duplicate key? It has me boggled.
 
Check to see if there are any triggers on the table that you are trying to insert in to.


-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Thanks. I check but no triggers. I decided to try inserting a batch at a time and that worked so far. Still confused. Its making me look bad. I cannot see any duplicates. Could it be the number of records I am inserting? I will continue inserting in batches.

Thank you for your time.

Richard
 
It's gotta be data. By importing in batches, you are probably inserting data that does not cause it to fail. I suspect that by the time you are done inserting all the data in batches, that you will eventually find it.


-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top