finding foreign keys

October 30th, 2008 by Mr.M | No Comments »

When you are attempting to drop an index on a table, you are given the following error:

An explicit DROP INDEX is not allowed on index ‘db.tbl_name.index_name’. It is being used for UNIQUE KEY constraint enforcement.

This normally means that the index on the table you are trying to modified is being referenced by another table somewhere somehow, which means, you have to find that other table, drop the FK there, and then you can go back to modifying the index. The following script will help you ID which table is use for the index that you are attempting to modify.

Before you drop the FK, you should script it out and then add it again after you made your changes.

Download Finding foreign keys Version v0.1

Leave a Reply

You must be logged in to post a comment.