| |
|
If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
|
 |

08-25-04, 11:32
|
|
Registered User
|
|
Join Date: Aug 2004
Location: STL
Posts: 45
|
|
|
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!
|
|

08-25-04, 13:57
|
|
Registered User
|
|
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.
|
|

08-27-04, 14:01
|
|
Registered User
|
|
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.
|
|

08-27-04, 14:15
|
|
Registered User
|
|
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?
|
|

08-27-04, 15:55
|
|
Registered User
|
|
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... 
|
|

08-28-04, 10:20
|
|
Registered User
|
|
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.
|
|

08-30-04, 09:11
|
|
Registered User
|
|
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...
|
|

08-30-04, 14:27
|
|
Registered User
|
|
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?
|
|

08-30-04, 14:45
|
|
Registered User
|
|
Join Date: Aug 2004
Location: STL
Posts: 45
|
|
I'm using MS SQL 2000....
Quote:
|
What columns in the UNION table is the Foreign Key constraint 'Employee_FK00' referencing?
|
It is the Union# column.
|
|

08-31-04, 09:47
|
|
Registered User
|
|
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#.
|
|

08-31-04, 12:40
|
|
Registered User
|
|
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!
|
|

08-31-04, 14:34
|
|
Registered User
|
|
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.
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|