1 Reply

Add a unique constraint to the Company table, such as
alter table dbo.Company add constraint companyid_Unique unique (CompanyID)
then you can define a foreign key from the Contacts table
alter table contacts
add constraint contacts_fk foreign key (companyid)
references company (CompanyID)
You don't need to reference a primary key in a FK relationship, just a UNIQUE constraint or index