mysql - Foreign Key Constraints on an Intersection Table -


i trying import data excel document mysql management studio, , when attempting so, data fails import on specific intersection table, has following data:

enter image description here

the table inserting called tyearleagues, , error receive states that:

an ole db record available. source: "microsoft sql server native client 11.0" hresult: 0x80004005 description: "the insert statement conflicted foreign key constraint "tyearleagues_tyears_fk". conflict occurred in database "dbsql2", table "dbo.tyears", column "intyearid"."

the intersection table set so:

create table tyearleagues (      intyearid              integer         not null     ,intleagueid            integer         not null     ,constraint tyearleagues_pk primary key (intyearid, intleagueid) ) 

and foreign key constraint so:

alter table tyearleagues add constraint tyearleagues_tyears_fk foreign key ( intyearid ) references tyears( intyearid ) 

whereas understand issue in normal table, tyearleagues intersection table, , there no duplicate records, not understand issue.

edit: added tyears table, better clarity. @ least, intyearids 1-3 accounted for.

enter image description here

i don't think it's complaining duplicates, means inserting row refers year not exist in tyears


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -