T-SQL: Cannot drop the index because it does not exist or you do not have permission.

2010 February 1
by r.claypool

database

Quick tip:   The table name and index name are required to drop an index, otherwise SQL Server will return an error.

e.g.

DROP INDEX [dbo].[IX_MyIndex]

fails with …

Msg 3701, Level 11, State 6, Line XX
Cannot drop the index 'dbo.IX_MyIndex', 
because it does not exist or you do not have permission.

However,

DROP INDEX [dbo].[MyTable].[IX_MyIndex]

will work fine if it exists and you have sufficient permissions. (Use Select user_name() to determine your user context, which will help to verify the permissions being used.)

No comments yet

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS

Creative Commons Attribution 3.0 United States
Creative Commons Attribution 3.0 United States