sql - Foreign key reference the following error is showing : the columns in the table 'table' do not match an existing primary key or UNIQUE constraint -
i have 2 tables probcodes , workorders
probcodes:
- primary key :
probcodeid - column :
problemcode
workorders:
- primary key :
workorderid - column :
problemcode
my question :
how can create foreign key reference between problemcode in probcodes , problemcode in workorders?
by putting unique constraint on problemcode in probcodes.
the error message says all. foreign key in workorders has reference either primary key or unique column in probcodes. otherwise, if there duplicate problemcodes in probcodes, how can sql know row reference in parent table?
Comments
Post a Comment