Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

Mysterious foreign key errors

$
0
0

I have a table that I am trying to import data into. It is titled Wage. It has a column field titled "occcode". It is short for occupation code. It has a foreign key relationship to OCCCODES. When I attempt to import wage, I get the usual error,

" The MERGE statement conflicted with the FOREIGN KEY constraint "FK_WAGE_OCCCODES".

In plain English, I know that this tells me that I have occcode values in dbo.wage that are not in dbo.occcodes. Simple enough or so I thought. My usual plan of action is to take the "offending" column or in this case, occcode, from the two tables and place them in excel. From there, I run a match function on the two columns and that has worked until now. However, no N/A's pop up this time. This tells me that all values of occcode that are in WAGE are also in OCCCODES. Any suggestions for a better way to find...


Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>