Explore Courses Blog Tutorials Interview Questions
0 votes
in SQL by (6.1k points)

I would like to remove the constraints from my table. 

My query is:

ALTER TABLE `tbl_magazine_issue` 
DROP CONSTRAINT `FK_tbl_magazine_issue_mst_users`

However, I am getting the following error:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'constraint FK_tbl_magazine_issue_mst_users' at line 1

1 Answer

0 votes
by (12.7k points)
edited by

MySQL has a special syntax for dropping the foreign key constraints:

ALTER TABLE tbl_magazine_issue
  DROP FOREIGN KEY FK_tbl_magazine_issue_mst_users

Want to be a SQL expert? Join this Intellipaat's SQL Certification program to learn more. 

Watch the below MySQL video tutorial to gain more knowledge on MySQL...

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories