Re: violation of primary key constraint

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Darren Green (darren.green_at_reply-to-newsgroup-sqldts.com)
Date: 03/16/04


Date: Tue, 16 Mar 2004 17:23:44 +0000

In message <O#o5Xi3CEHA.4080@TK2MSFTNGP09.phx.gbl>, Andrew Gale
<AGale10495@aol.com> writes
>when i try to run a sql server package from visual basic, i get the
>following message:
>
>Execution Started: 3/16/2004 11:31:54 AM
>Error at Destination for Row number 26276. Errors encountered so far in this
>task: 1.
>Error Source: Microsoft OLE DB Provider for SQL Server
>Error Description:The statement has been terminated.
>Error Help File:
>Error Help Context ID:0
>Error Source: Microsoft OLE DB Provider for SQL Server
>Error Description:Violation of PRIMARY KEY constraint 'PK_SIG'. Cannot
>insert duplicate key in object 'SIG'.
>Error Help File:
>Error Help Context ID:0
>Execution Completed: 3/16/2004 11:32:00 AM
>
>
>the data being imported is unique and i even removed the primary keys and
>all data from the table, and i still get this error.
>everything used to work fine - but we recently upgraded to 2003 Server at
>work, and sql server 2000 no longer has the latest service pack (no service
>pack in fact). i ran several DBCC commands to no avail - the tables seem to
>be intact - i even dropped them and recreated them.
>
>note: i can run the packages successfully by hand from enterprise manager,
>just not from visual basic.
>
>could this be a bug that a service pack will fix? any help would be
>appreciated....
>
>i'm using winXP (server/client), sqlserver2000 (rtm), visual basic 6.0
>

Why is there no SP3 on SQL 2000. This should be applied for W2K3 to work
properly (when SQL is installed on W2K3).

I still doubt it is a SP issue though.

Is the VB program using the object model? Does it specify any GUIDs on
the LoadFromSQLServer method. Try using name only to ensure you get the
most recent version of the package.

Is VB and EM on the same machine? The package will run on the same
machine as the calling app, i.e. VB or EM.

-- 
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com
PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org


Relevant Pages

  • Re: Can you use osql in DTS?
    ... This sounds simple enough to do in a single package. ... ActiveX Script task to build the date and time strings to populate the ... Data Pump task that executes a proc that populates a table and then ... Columnist, SQL Server Professional ...
    (microsoft.public.sqlserver.dts)
  • Re: Can you use osql in DTS?
    ... This sounds simple enough to do in a single package. ... ActiveX Script task to build the date and time strings to populate the ... Data Pump task that executes a proc that populates a table and then ... Columnist, SQL Server Professional ...
    (microsoft.public.sqlserver.programming)
  • Re: violation of primary key constraint
    ... >>forget VB - i tried running the package thru enterprise manager on the ... >>But if i run the package on that table in DB "Emdcs3", ... >>permissions are fine - i guess i'll install the service pack tommorrow ... > Darren Green (SQL Server MVP) ...
    (microsoft.public.sqlserver.dts)
  • Re: Migrating DTS Local Package from test to production environments v7.0
    ... The version of SQL Server on which the package was create is SQL Server ... DTS runs at the client so manually will be on the invoker's PC which in this ...
    (microsoft.public.sqlserver.dts)
  • Re: The product level is insufficient for component "Fuzzy Lookup"
    ... I installed sql server service pack 2 and now ... The package executes successfully from within the IDE. ... clearly states fuzzy transforms are supported by the Developer Edition ...
    (microsoft.public.sqlserver.dts)