Re: Violation of Primary Key

From: Adam Machanic (amachanic_at_air-worldwide.nospamallowed.com)
Date: 03/02/04


Date: Tue, 2 Mar 2004 16:24:21 -0500

Maybe you could post your DML and sample data to reproduce the problem?
Sounds pretty straightforward to me... You're trying to insert a duplicate
row. When you say you "exported" the data, what does that mean? And how is
your primary key defined?

"Jennifer" <jennifer.newhouser@hcahealthcare.com> wrote in message
news:58223BA8-7141-4188-A178-B8BDF33E5A5E@microsoft.com...
> I am using SQL server 2000 and have been trying to import a table after I
exported it and made changes to it. I have also attempted to export the
table and then immediately import the table back to the same table without
making changes and I receive an error that says the following:
>
> Error at Destination for Row number 91. Errors encountered so far in this
task: 1
> The statement has been terminated.
> Violation of PRIMARY KEY constraint 'PK_CUSTOMERS'. Cannot insert duplicat
key in object 'Customers'.
>
> We have updated SQL to the newest Service Pack and still the problem
occurs here is the version info - Microsoft SQL Server 2000 - 8.00.818
(Intel X86) May 31 2003 16:08:15.....
> Does anyone have any ideas because we are all out. Thanks,



Relevant Pages

  • Re: want to see duplicates INNER JOIN
    ... Can you give CREATE TABLE statements and sample data, ... though - how do you expect to see duplicate rows in a result ... AshleyT wrote: ... It is a working table that I don't have a primary key in, and was hoping not to have to add one. ...
    (microsoft.public.sqlserver.mseq)
  • Re: Allen Brownes function: "Duplicate record (and related child record)" -- my modified ver
    ... Duplicate the main form record and related records in the subform. ... Dim strSQL As String ... Dim lngOldID As Long '*** Primary key value of the orginial record. ... - "TrackingNumber" is primary key ...
    (microsoft.public.access.formscoding)
  • Re: Allen Brownes Copying forms/Subforms
    ... Is OrderID the primary key? ... Allen Browne - Microsoft MVP. ... perhaps the duplicate is on another field where you specified a "No ...
    (microsoft.public.access.modulesdaovba)
  • RE: Duplicate record with child fields
    ... with the sub table tblWesternBlotWorksheetsub ... record and trying to put it in the primary key of the new record. ... to copy duplicate records with child fields. ... GelNumber is the primary Key in the main table with a 1:N relationship ...
    (microsoft.public.access.forms)
  • Re: New to SQL and trying multiple table joins
    ... > Can't be certain of how to write this query for you without DDL (CREATE ... Previous msg edited plus added in keys, and sample data at end. ... EmpAvailID (Primary Key), EmpID, EAMonthID(Foreign ... AbilityID, EmpID, MainAbility ...
    (microsoft.public.sqlserver.programming)