468,514 Members | 1,625 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,514 developers. It's quick & easy.

Can't delete any foreign key on every query to drop foreign key

mysql> alter table employee_salary drop foreign key empid;
ERROR 1025 (HY000): Error on rename of '.\hjj\employee_salary' to '.\hjj\#sql2-16c-1' (errno: 152)
plz solve this
Dec 12 '12 #1
2 1566
PreethiGowri
126 64KB
check if the name of foreign key you mentioned is correct
Dec 12 '12 #2
PreethiGowri
126 64KB
use the following query to known the name of the foreign key
Expand|Select|Wrap|Line Numbers
  1. SHOW CREATE TABLE table_name
you can also use the constraint name rather than the column name of the foreign key
Dec 12 '12 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

7 posts views Thread by harry | last post: by
6 posts views Thread by Rated R1 | last post: by
3 posts views Thread by Scott_Tuttle | last post: by
2 posts views Thread by amrhi | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.