Results 1 to 12 of 12
  1. #1
    Join Date
    Aug 2004
    Location
    STL
    Posts
    45

    Unanswered: 547 error: help decoding

    Can someone explain in more detail, or in plain english, what this error is trying to say.. ???

    "An SQL error occured - 547 error: INSERT conflicted with column Foreign Key constraint 'Employee_FK00'. The conflict occured in database NAME, table 'Union', column 'UnionName'. "

    I get this error aftering trying to add a new row in my .Net Winform i'm developing. Thanks!

  2. #2
    Join Date
    Aug 2004
    Posts
    330
    It looks like you are trying to insert a row in a child table without a parent row. Make sure that there is a row in the table that 'Employee_FK00' is referencing before you do the insert.

  3. #3
    Join Date
    Aug 2004
    Location
    STL
    Posts
    45
    Well.. more specifically, there are two tables 1. Employee and 2. tbl_Union. In the employee table there is Lastname, firstname, EmployeeID, and Union. All the different Unions are in the tbl_Union, with a Union# and Union Name field. Both tables have rows in them.

    The vb.net Application was taking the Union# from the tbl_Union and inserted the value in Union under Employee. But i keep getting that SQL error.

  4. #4
    Join Date
    Aug 2004
    Posts
    330
    According to the error message, the foreign key is trying to match on UnionName, not Union#. Can you provide the DDL for the tables, including the foriegn key constraint definition?

  5. #5
    Join Date
    Aug 2004
    Location
    STL
    Posts
    45
    Sure can, but i need your help. What is the best way to get this information? I'm new to this...

  6. #6
    Join Date
    Aug 2004
    Posts
    330
    It depends. I just need the column names of the tables and the foreign key definition. I suspect that you are populating the union#, but for some reason, the foreign key is trying to point to UnionName.

  7. #7
    Join Date
    Aug 2004
    Location
    STL
    Posts
    45
    Well there is the "EMPLOYEE" table, which has fields Employee# (Primary Key), lastname, firstname, union. Then, there is the "UNION" table with fields, Union# (Foreign key), and UnionName. That's the basics...

  8. #8
    Join Date
    Aug 2004
    Posts
    330
    What DBMS are you using? What columns in the UNION table is the Foreign Key constraint 'Employee_FK00' referencing?

  9. #9
    Join Date
    Aug 2004
    Location
    STL
    Posts
    45
    I'm using MS SQL 2000....

    What columns in the UNION table is the Foreign Key constraint 'Employee_FK00' referencing?
    It is the Union# column.

  10. #10
    Join Date
    Aug 2004
    Posts
    330
    I think you have your foriegn key defined incorrectly. If you look at the error message, it is trying to find a parent record with matching column 'UnionName' instead of Union#.

  11. #11
    Join Date
    Aug 2004
    Location
    STL
    Posts
    45
    Actually, that is a error on my part, its not the 'UnionName', but the 'Union#'. I typed that wrong in my original statement.

    I'm currently in the SQL Server enterprise design area on the tables, looking at the indexes/keys tabs, etc. I guess this is the area I need to play in to figure it out. Thanks!

  12. #12
    Join Date
    Aug 2004
    Location
    STL
    Posts
    45
    I also found this thread that deals with the same situation I think.. http://www.dbforums.com/t700898.html

    I did upgrade from access 2000 to ms sql as well, if that messed something up - I dont know.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •