MySQL Forums
Forum List  »  InnoDB

Drop foreign key only if it exists
Posted by: Eugene Chechel
Date: July 17, 2008 02:24AM

I'm doing this, but it doesn't work.
ALTER TABLE `object` DROP FOREIGN KEY IF EXISTS `object_ibfk_1`;

I've tried to put this IF EXISTS wherever I could. How can check if foreign key is exists before drop it?

Options: ReplyQuote


Subject
Views
Written By
Posted
Drop foreign key only if it exists
29281
July 17, 2008 02:24AM
19252
February 11, 2009 01:32PM
12923
February 12, 2009 10:47AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.