I have two tables one has a three column composite key. The other needs to reference this composite key.
What is the syntax for creating a foreign key which references multiple columns.
I tried googleing, but I couldn't find it.
FOREIGN KEY (col1, col2, col3) REFERENCES ParentTable (colA, colB, colC)
Look under "<table_constraint>
" in the online docs for Microsoft SQL Server CREATE TABLE.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With