locked
Foreign Key issue RRS feed

  • Question

  • All;

    I'm running SQL 2012, and this is my first attempt to input data into a table with Foreign keys.  I'm getting this error message:

    [OLE DB Destination [101]] Error: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80040E2F.

    An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 11.0"  Hresult: 0x80040E2F  Description: "The statement has been terminated.".

    An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 11.0"  Hresult: 0x80040E2F  Description: "The INSERT statement conflicted with the FOREIGN KEY constraint "fk_Opener". The conflict occurred in database "Insight Cloud", table "dbo.Opener", column 'Opener_Name'.".

    Can somebody help me with this? 

    Thank you

    Brian


    Brian Geregach

    Wednesday, April 10, 2013 7:05 PM

Answers

  • The problem is pretty self explanitory.  The table you are inserting into has a FK constraint on the Opener_Name column and you are inserting a value that does not exist in the related table.

    Chuck Pedretti | Magenic – North Region | magenic.com

    • Proposed as answer by ArthurZ Wednesday, April 10, 2013 8:24 PM
    • Marked as answer by bgeregach Wednesday, April 10, 2013 8:25 PM
    Wednesday, April 10, 2013 7:11 PM

All replies

  • The problem is pretty self explanitory.  The table you are inserting into has a FK constraint on the Opener_Name column and you are inserting a value that does not exist in the related table.

    Chuck Pedretti | Magenic – North Region | magenic.com

    • Proposed as answer by ArthurZ Wednesday, April 10, 2013 8:24 PM
    • Marked as answer by bgeregach Wednesday, April 10, 2013 8:25 PM
    Wednesday, April 10, 2013 7:11 PM
  • Thank you for that, sorry about the easy question, I'm just learning.  I did find multiple missing values due to this.

    Brian


    Brian Geregach

    • Marked as answer by bgeregach Wednesday, April 10, 2013 8:25 PM
    • Unmarked as answer by bgeregach Wednesday, April 10, 2013 8:25 PM
    Wednesday, April 10, 2013 7:49 PM