data import from a text file into a SQL 2008 database
Here is the error I get - Copying to [dbo].[Customers] (Error) Messages * Error 0xc0202009: Data Flow Task 1: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005. An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80004005 Description: "The statement has been terminated.". An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80004005 Description: "Violation of PRIMARY KEY constraint 'aaaaaCustomers_PK'. Cannot insert duplicate key in object 'dbo.Customers'.". (SQL Server Import and Export Wizard) * Error 0xc0209029: Data Flow Task 1: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "input "Destination Input" (35)" failed because error code 0xC020907B occurred, and the error row disposition on "input "Destination Input" (35)" specifies failure on error. An error occurred on the specified object of the specified component. There may be error messages posted before this with more information about the failure. (SQL Server Import and Export Wizard) * Error 0xc0047022: Data Flow Task 1: SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "Destination - Customers" (22) failed with error code 0xC0209029 while processing input "Destination Input" (35). The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running. There may be error messages posted before this with more information about the failure. (SQL Server Import and Export Wizard) My Server is Windows 2008 R2 Jeffrey Phelps
August 21st, 2012 10:59am

Jeffrey, "Violation of PRIMARY KEY constraint 'aaaaaCustomers_PK'. Cannot insert duplicate key in object 'dbo.Customers'." -- means exactly that. Make sure you insert the unique records only. Perhaps you need a merge, then use the T-SQL MERGE for the records that conflict.Arthur My Blog
Free Windows Admin Tool Kit Click here and download it now
August 21st, 2012 11:11am

I am using the SQL Server management studio import wizard. These are my only choices to make. Where does it see the key violation?Jeffrey Phelps
August 21st, 2012 12:37pm

When you run it, it bombs sir.Arthur My Blog
Free Windows Admin Tool Kit Click here and download it now
August 21st, 2012 1:57pm

The problem is that your table that you're importing rows into has a constraint on it. The person that designed the table is requiring that certain columns in the Customers table be unique for each row. (The error doesn't tell us which columns, but looking at the table definition in SSMS will tell you what columns are part of the primary key.) The data you're trying to import has either: Two rows within it that have the same values in those key columns, OROne (or more) rows within it that have the same values in the key columns as rows already existing in the table. So, for example, we can assume your Customers table has a primary key defined as the telephone number. If that's the case, then your import file has two customers with the same telephone number... OR one of the customers you're importing has the same telephone number as one of the customers already in the table. Talk to me now on
August 21st, 2012 8:13pm

The problem is that your table that you're importing rows into has a constraint on it. The person that designed the table is requiring that certain columns in the Customers table be unique for each row. (The error doesn't tell us which columns, but looking at the table definition in SSMS will tell you what columns are part of the primary key.) The data you're trying to import has either: Two rows within it that have the same values in those key columns, OROne (or more) rows within it that have the same values in the key columns as rows already existing in the table. So, for example, we can assume your Customers table has a primary key defined as the telephone number. If that's the case, then your import file has two customers with the same telephone number... OR one of the customers you're importing has the same telephone number as one of the customers already in the table. Talk to me now on
Free Windows Admin Tool Kit Click here and download it now
August 21st, 2012 8:16pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics