Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Used similar to this : ALTER TABLE YOURTABLENAME ADD CONSTRAINT fk_name_yourname FOREIGN KEY (FIELDNAME) REFERENCES OTHERTABLE (OTHERFIELDNAME) ON DELETE CASCADE

Also, see this link.

Used similar to this : ALTER TABLE YOURTABLENAME ADD CONSTRAINT fk_name_yourname FOREIGN KEY (FIELDNAME) REFERENCES OTHERTABLE (OTHERFIELDNAME) ON DELETE CASCADE

Also, see this link.

Edit:

If you have an existing key already (without the DELETE CASCADE) you must first drop the existing key:

ALTER TABLE YOURTABLENAME DROP CONSTRAINT fk_existingkey_name