Skip to content
Advertisement

How to create Multiple-field foreign key in Access?

I have found this tutorial, which says that question can be solved this way:

Multiple-field constraint:

For my simplified database:

enter image description here

I wrote such sql code, which has an idea to connect 2 columns from 2 tables. In addition, I would like to add unique constraint on 2 field of S2T table:

But I get an error, saying that I have syntax error in Alter table construction, please help

Advertisement

Answer

This works as should, seems to be that official tutorial confusing:

Mentioned uniqueness can be achieved this way (might be helpful for creating 1 to 1 connection)

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement