Thursday, February 16, 2012

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!This might be because you are trying to inserting a detail record that expects a header record to exist in another table.

For example, say you are trying to insert 'Union_1' into column in a table (employee?), but that table has a constraint where 'Union_1' MUST exist in table union in column unionname. If 'Union_1' does not exist in union, it is not going to allow you to insert it into the other table.

BTW, Union is a keyword so I'd be careful with using it as a table name.

Select * from a
union
select * from b

No comments:

Post a Comment