Hi All,
I have developed a custom Data Entity by taking reference from the standard entity CustomerAttachmentsV2Entity, which allows importing attachments. In this entity, there is a field called DocumentId, which is the primary key and of type GUID.
1.When I import a single attachment without providing DocumentId in Excel, it works fine.
2.When I try to import multiple records without DocumentId in Excel, the import throws an error.
3.I attempted to generate the GUID through code by writing logic in the staging table insert method and also in the onInserting event handler, but these methods were not triggered.
4.I need guidance on how to generate a new GUID for every record during import. Since I have to import nearly 10,000 attachments, manually entering GUIDs is not feasible.
the below is the error
<?xml version="1.0"?><Errors><Error><ErrorCode>-1071636471</ErrorCode><SubComponent>OLE DB Destination [76]</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_30743STAGINGIDX'. Cannot insert duplicate key in object 'dbo.IIT_RCAPROCESSATTACHMENTSSTAGING'. The duplicate key value is (5637144576, Importing multiple jpg attachments of RCA, Importing multiple jpg attachments of RCA-2025-08-28T05:12:38-8E6CE50089534EFB8F6734CB952, 00000000-0000-0000-0000-000000000000).".
</Description></Error><Error><ErrorCode>-1071607767</ErrorCode><SubComponent>OLE DB Destination [76]</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" (76) failed with error code 0xC0209029 while processing input "OLE DB Destination Input" (89). 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>
Failed to insert record into staging table. The keys of the record are DEFINITIONGROUP, DOCUMENTID, EXECUTIONID, PARTITION. Duplicate records must be removed from the file prior to import.
'0' 'RCA Process Attachments' record(s) inserted in staging
Thanks in advance.