Answered SSIS load failure

  • 2012년 4월 23일 월요일 오전 8:31
     
     

    Hi,

    created a really simple load package: go to flat file (through flatfile connection) select all columns and dump these in a database file (through a oledb connection). For the oledb connection I use windows authentication. When executing this package, I receive an error message;

    Error: 0xC0202009 at Data Flow Task, OLE DB Destination [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: "Violation of PRIMARY KEY constraint 'PK__Opera_ge__33C11D2347DBAE45'. Cannot insert duplicate key in object 'dbo.Opera_1'. The duplicate key value is (032159L).".

    Error: 0xC0209029 at Data Flow Task, OLE DB Destination [1]: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "input "OLE DB Destination Input" (14)" failed because error code 0xC020907B occurred, and the error row disposition on "input "OLE DB Destination Input" (14)" 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.

    Error: 0xC0047022 at Data Flow Task, SSIS.Pipeline: SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "OLE DB Destination" (1) failed with error code 0xC0209029 while processing input "OLE DB Destination Input" (14). 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.

    Information: 0x40043008 at Data Flow Task, SSIS.Pipeline: Post Execute phase is beginning.

    What are my options?

    thnx in advance

    Maarten

모든 응답

  • 2012년 4월 23일 월요일 오전 8:39
     
     

    An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80004005 Description: "Violation of PRIMARY KEY constraint 'PK__Opera_ge__33C11D2347DBAE45'. Cannot insert duplicate key in object 'dbo.Opera_1'. The duplicate key value is (032159L)."

    Hello Maarten,

    You are trying to insert data, which by the primary key already exists, therefore you get an error.


    Olaf Helper
    * cogito ergo sum * errare humanum est * quote erat demonstrandum *
    Wenn ich denke, ist das ein Fehler und das beweise ich täglich
    Blog Xing

  • 2012년 4월 23일 월요일 오전 8:47
     
     

    Hello Olaf,

    thnx for swift response, found out my self that the PK was the problem but now i have next question: the load is no problem; data is loaded into table (table has no PK) and after load I want to set my PK in the table but after doing this I get following message:

    The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.Opera' and the index name 'PK_Opera_gepl'. The duplicate key value is (032159L).Could not create constraint.

    According to the application manager all values in table are unique, so this error should not appear...

    Any idea what is going wrong?

    thnx in advance

    Maarten

  • 2012년 4월 23일 월요일 오전 8:57
     
     답변됨 코드 있음

    It's simple, you have duplicate values in your table.

    Find them with the following query:

    SELECT myPKColumn
    FROM myTable
    GROUP BY myPKColumn
    HAVING COUNT(myPKColumn) > 1


    MCTS, MCITP - Please mark posts as answered where appropriate.

    • 답변으로 표시됨 emveha86 2012년 4월 23일 월요일 오전 10:40
    •  
  • 2012년 4월 23일 월요일 오전 10:40
     
     

    Hi Koen,

    there were indeed duplicate values in the table, they were deleted.

    thnx for response