Re: Referencing multiple primary keys

2004-02-11 Thread Jonas Lndén
I solved it myself :) You need to keep the primary keys in the same order as the index, DOH! ofcourse :) In parant table PRIMARY KEY(key1,key2) In child table INDEX(key_fk1, key_fk2) Regards /Jonas - Original Message - From: "Jonas Lndén" <[EMAIL PROTECTED]> To: &

Referencing multiple primary keys

2004-02-11 Thread Jonas Lndén
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, f