Click here to Skip to main content
14,270,872 members
Rate this:
Please Sign up or sign in to vote.
violation of FOREIGN KEY constraint "FK_LVE_ECP_WGR_WGR" on table "LVE_ECP"
Foreign key reference target does not exist
Posted

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

The error message is not a lie.

A SQL command tried to input an orphan record in the child table, without a corresponding record in the parent table.

Try sp_helpconstraint on FK_LVE_ECP_WGR_WGR, read carefully its output. You will get the name of the parent table, and the column(s) involved.

Hope this helps.
   
v2
Comments
fjdiewornncalwe 24-Jan-12 11:01am
   
+5. Excellent answer.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100