Failed to insert record into staging table. The keys of the record are DEFINITIONGROUP, EXECUTIONID, INVENTORYLOTID, PARTITION. Duplicate records must be removed from the file prior to import. <?xml version="1.0"?><Errors><Error><ErrorCode>-1071636471</ErrorCode><SubComponent>OLE DB Destination [526]</SubComponent><Description>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 11.0" Hresult: 0x80004005 Description: "The statement has been terminated.". An OLE DB record is available. Source: "Microsoft SQL Server Native Client 11.0" Hresult: 0x80004005 Description: "Violation of PRIMARY KEY constraint 'I_18374STAGINGIDX'. Cannot insert duplicate key in object 'dbo.SALESORDERLINEV2STAGING'. The duplicate key value is (5637144576, import sales line v2, import sales line v2-2025-01-13T00:35:23-B8EA12CAB8EC4098BED3327A437E9854, ).". </Description></Error><Error><ErrorCode>-1071607767</ErrorCode><SubComponent>OLE DB Destination [526]</SubComponent><Description>SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "OLE DB Destination.Inputs[OLE DB Destination Input]" failed because error code 0xC020907B occurred, and the error row disposition on "OLE DB Destination.Inputs[OLE DB Destination Input]" 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. </Description></Error><Error><ErrorCode>-1073450974</ErrorCode><SubComponent>SSIS.Pipeline</SubComponent><Description>SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "OLE DB Destination" (526) failed with error code 0xC0209029 while processing input "OLE DB Destination Input" (539). 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. </Description></Error></Errors>
DEFINITIONGROUP, EXECUTIONID, INVENTORYLOTID, PARTITION
Hii, You are receiving the error because the staging table's primary key constraint is being violated during bulk import. The staging table for the SalesOrderLineV2Entity includes key columns such as PARTITION, DEFINITIONGROUP, EXECUTIONID, and INVENTORYLOTID. When you import one record at a time, the combination of these key fields remains unique, so the import is successful. However, when you try to import multiple records together and the INVENTORYLOTID is either blank or null in all rows (which is likely due to the outer join you added on SalesLine), the same key combination is repeated, causing a duplicate key error.
SalesOrderLineV2Entity
PARTITION
DEFINITIONGROUP
EXECUTIONID
INVENTORYLOTID
To resolve this issue, you need to ensure that the INVENTORYLOTID or whichever field is causing the duplication has a unique value for each record. One way to do this is to update your Excel file to assign a unique value (like a row number or identifier) in a column that maps to a key field in the entity. Alternatively, you can fix this in your customization by making sure the join with SalesLine doesn’t result in null values, or by programmatically assigning a unique temporary value to the INVENTORYLOTID in your data processing logic. Avoid modifying the staging table’s primary key unless absolutely necessary, as it may break the standard data management functionality. Ensuring uniqueness in the key fields is the safest and recommended approach to avoid such errors during bulk import.
SalesLine
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
CA Neeraj Kumar 753
André Arnaud de Cal... 752 Super User 2025 Season 2
Sohaib Cheema 534 User Group Leader