Hello, I am banging my head against the wall trying to figure out how to construct a 
foreign key towards a table with a primary key consisting of two columns. I have been 
googling around and thought this would work, but it just gives me an ERROR 1005.

ALTER TABLE testDB ADD FOREIGN KEY (fkey1, fkey2) REFERENCES secondDB(col1, col2) ON 
DELETE SET NULL; 

Is there someone who could point me in the right direction? I have indexed the foreign 
keys in testDB.

Regards
/Jonas Lindén

Reply via email to