Thursday, March 30, 2006 03:09 PM
I'd like to be able to mark one of the columns in table "table1" to be a foreign key from table "table2". Both tables are already populated with data. I use MySQL 5.0. So I'd like to do something like this:
ALTER TABLE table1 ADD FOREIGN KEY (column_to_modify) REFERENCES table2 (id_column_from_table2) ON DELETE CASCADE ON UPDATE NO ACTION;
I get an error when I do this. Any ideas? I will appreciate any input, thank in advance.
Re: MySQL 5.0 - setting foreign key for a column
Thursday, March 30, 2006 05:03 PM