SQL Foreign Keys

From Kb

Jump to: navigation, search

How to drop a Foreign Key from a table:

ALTER TABLE `tablename` DROP FOREIGN KEY `fk_name`;

Note: in the table definition the FK is also known as the CONSTRAINT

How to drop a Key from a table:

ALTER TABLE `tablename` DROP KEY `k_name`;