Last active: Never
Not logged in [
Login
-
Register
]
Search
FAQ
Member List
Today's Posts
Stats
Back to:
Xnote.com Technical Forums
»
MySQL
» Create Foreign Key
Printable Version
|
Subscribe
|
Add to Favourites
Author:
Subject: Create Foreign Key
Alan Fullmer
Super Administrator
Posts: 62
Registered: 8-12-2004
Member Is Offline
Mood:
No Mood
posted on 10-2-2010 at 12:07 PM
Create Foreign Key
create index [index name] on [table name] ([field name]);
alter table [table name]
add constraint [constraint name]
foreign key ([field name])
references [foreign table name] ([foreign field name])
--
optionally you can add to the end:
on delete cascade
on delete set null
www.xnote.com
www.zoobuh.com
Xnote.com Technical Forums
»
MySQL
» Create Foreign Key
Powered by XMB
Developed By
Aventure Media
&
The XMB Group
© 2002-2007