Monday, February 23, 2015

Errors while importing data from Excel to SQL Server and their solutions - 3

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 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: "The INSERT statement conflicted with the FOREIGN KEY constraint "cust_order_id". The conflict occurred in database "Wallmart", table "dbo.Customer", column 'Cust_id'.".
 (SQL Server Import and Export Wizard)

Error 0xc0209029: Data Flow Task 1: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.  The "Destination - Order_Wallmart.Inputs[Destination Input]" failed because error code 0xC020907B occurred, and the error row disposition on "Destination - Order_Wallmart.Inputs[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.
 (SQL Server Import and Export Wizard)

Error 0xc0047022: Data Flow Task 1: SSIS Error Code DTS_E_PROCESSINPUTFAILED.  The ProcessInput method on component "Destination - Order_Wallmart" (41) failed with error code 0xC0209029 while processing input "Destination Input" (54). 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)

 
When I got this error, I was bit confused because earlier when I got error with integrity constraint I was trying to insert NULL value in primary key column. Here I noticed that when I tried to insert data in the destination column I was actually entering some values which were not present in the referenced column. i.e I was trying to insert data values in order table's foreign key column linked to customer table  which were not present  in the primary key column  of customer table. When I added those missing values the customer table, sqlserver allowed me to enter data in order table successfully.

No comments:

Post a Comment