Reputation: 822
I have two tables. I want to create a relationship between them. But the first table has two primary keys.
SpaDefinition Table:
BranchId,Id(PK),LanguageId(PK),Name
SpaPhotos Table:
BranchId, Id(PK),SpaDefinitionId,Data
The SpaPhotos table should have a relationship with SpaDefinition table.
Could anyone help me?
Upvotes: 1
Views: 69
Reputation: 31795
The only way you can create a foreign key in SpaPhotos that will reference SpaDefinition is to either:
A foreign key must contain ALL of the columns of the primary key of the table it is referencing.
Upvotes: 2