Import Wizard to SQL from Excl

  • I am trying to upload data to the SQL from a Excel spreadsheet. When I run the packet I get these errors. When trying to explain to me what I need to do, try and be as detailed as possible, as I am not nearly as tech savvy as others.

    [Destination 1 - XRef_Part 1 1 [951]] Error: An OLE DB error has occurred. Error code: 0x80004005. An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80004005 Description: "The statement has been terminated.". An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80004005 Description: "Violation of PRIMARY KEY constraint 'PK_XRef_Part'. Cannot insert duplicate key in object 'dbo.XRef_Part'.".

    [DTS.Pipeline] Error: The ProcessInput method on component "Destination 1 - XRef_Part 1 1" (951) failed with error code 0xC0202009. 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.

    [DTS.Pipeline] Error: Thread "WorkThread0" has exited with error code 0xC0202009.

  • Hello,

    The first error message refers to a Primary Key Violation. (A Primary-Key is the Column(s) that uniquely identify a record in a table). This suggests that either the data you are importing has two (or more) records with the same Primary-Key, or that the record already exists in your target table.

    You can use SSMS (SQL Server Management Studio) to inspect the target table. Check which Column(s) is/are the Primary-Key and see if duplicates do exist in your Excel spreadsheet.

    If there are no duplicates, you could load your data into an empty copy of the target table and then do a Select with an Inner Join on the Primary-Key, and this will show you if the data already exists.

    Regards,

    John Marsh

    www.sql.lu
    SQL Server Luxembourg User Group

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply