Page 1 of 1

sql needed for adding foreign keys

Posted: Sun Jul 03, 2005 4:40 am
by raghavan20
I forgot to create foreign keys during the creation of tables and i want to add foreign keys now.

I want the syntax format for one instance so that I can build for others

two tables: Members_tbl, UserAccounts_tbl
both have got MemberId field
and Members_tbl.MemberId references UserAccounts_tbl;

how to put all of these together as a sql stmt?

Posted: Sun Jul 03, 2005 5:49 am
by timvw
Do a websearch on "sql alter foreign key".

http://dev.mysql.com/doc/mysql/en/innod ... aints.html