The likely cause for this is that you might have more than one index named xyz on your database. Your IF EXISTS SELECT statement is not taking into consideration which table xyz is on.

You can check for this condition yourself by running the select statement by itself.

Try changing your query to the following to limit the scope:

If Exists 
(
    Select * 
    From   sys.indexes 
    Where  name = 'xyz' 
    And    Object_Id = Object_Id('dbo.Table_Name')
)
Drop Index xyz On dbo.Table_Name;
Answer from Siyual on Stack Overflow
🌐
W3Schools
w3schools.com › sql › sql_ref_drop_index.asp
SQL DROP INDEX
SQL Examples SQL Editor SQL Quiz SQL Exercises SQL Server SQL Syllabus SQL Study Plan SQL Bootcamp SQL Training ... The DROP INDEX command is used to delete an index in a table.
Discussions

IF EXISTS DROP INDEX ... IF NOT EXISTS CREATE INDEX – SQLServerCentral Forums
Create With drop_existing is equivalent to DROP INDEX ... CREATE INDEX, not IF EXISTS ... DROP INDEX ... CREATE INDEX · Gail Shaw Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci) SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability More on sqlservercentral.com
🌐 sqlservercentral.com
August 13, 2012
cannot drop index
im trying to drop an index in sqlserver management studio and it times out. i'm doing it in the modify table section (clicking on index) then trying to remove it. it just hangs there. any queries i try to run which are using that index are also hanging. i have tried to reboot the server and it ... More on experts-exchange.com
🌐 experts-exchange.com
February 1, 2011
sql server - How to disable or delete an index - Database Administrators Stack Exchange
I created a non-clustered index on a live server (SQL Server 2008 R2) and it turned out not to give the performance benefits that I was hoping for. So I want to delete the index again. Unfortunat... More on dba.stackexchange.com
🌐 dba.stackexchange.com
April 28, 2014
Dropping index
Dropping an index in SQL Server can take a very long time due to several reasons, especially if the index is clustered or if there are multiple indexes on the table. When dropping a clustered index, SQL Server has to transform the data from the clustered index structure back into a heap, which ... More on experts-exchange.com
🌐 experts-exchange.com
October 18, 2025
🌐
SQLServerCentral
sqlservercentral.com › home › topics › if exists drop index ... if not exists create index
IF EXISTS DROP INDEX ... IF NOT EXISTS CREATE INDEX – SQLServerCentral Forums
August 13, 2012 - Couldn't you just make sure that the index name exists and then drop it? ... Index names are only unique per table. It's quite possible to have the same name for an index on multiple tables. Gail Shaw Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci) SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
🌐
GeeksforGeeks
geeksforgeeks.org › sql › sql-drop-index
SQL DROP INDEX Statement - GeeksforGeeks
Create a table, add an index using the CREATE INDEX statement and then remove it using the DROP INDEX statement.
Published   June 19, 2026
🌐
InterSystems
docs.intersystems.com › irislatest › csp › docbook › DocBook.UI.Page.cls
DROP INDEX (SQL) | InterSystems SQL Reference | InterSystems IRIS Data Platform 2026.2
The DROP INDEX command is a privileged operation. The user must have %ALTER_TABLE administrative privilege to execute DROP INDEX. Failing to do so results in an SQLCODE –99 error with the %msg User 'name' does not have %ALTER_TABLE privileges.
Find elsewhere
🌐
PopSQL
popsql.com › learn-sql › sql-server › how-to-drop-an-index-in-sql-server
SQL Server: Drop an Index - PopSQL
Learn how to drop indexes in SQL Server to improve database performance. Use "DROP INDEX" with the desired table and index name. For primary keys, utilize "ALTER TABLE" followed by "DROP CONSTRAINT."
🌐
Experts Exchange
experts-exchange.com › questions › 26787625 › cannot-drop-index.html
Solved: cannot drop index | Experts Exchange
February 1, 2011 - Then try DROP TABLE. If all fails use the SQL Manager to manually delete the table. Tell us what happened. ... i am sysadmin on the machine and also dbo...have lots of permissions. i don't want to delete the table. i only want to delete the index because it is causing my entire application to hang.
🌐
Scaler
scaler.com › home › topics › sql drop index
SQL Drop Index - Scaler Topics
February 29, 2024 - SQL Server: SELECT * FROM information_schema.table_constraints WHERE table_name = 'Employees'; If the operation was successful, the constraint (and its associated index) you dropped will no longer appear in the output of these commands, confirming that it has been removed from the table.
🌐
Sqlespresso
sqlespresso.com › home › performance tuning › sql index creation using drop existing= on
SQL Index Creation Using DROP EXISTING= ON - A Shot of SQLEspresso
February 17, 2021 - When you are making changes to an existing Non-Clustered index SQL Server provides a wide variety of options. One of the more frequently used methods is DROP EXISTING; in this post you will learn all about that option. This option automatically drops an existing index after recreating it, without ...
🌐
Tutorialspoint
tutorialspoint.com › sql › sql-drop-index.htm
SQL - Drop Index
The DROP statement in SQL is used to remove or delete an existing database object such as a table, index, view, or procedure. Whenever we use DROP statement with any of the database objects, it will remove them permanently along with their
🌐
Brent Ozar Unlimited®
brentozar.com › home › blog › how to drop all your indexes – fast
How to Drop All Your Indexes - Fast - Brent Ozar Unlimited®
July 19, 2022 - Sometimes I need to reset stuff during performance training classes. I know some of you teach classes, too, and some of you just like doing crazy stuff. So here you go, a stored procedure to lose weight fast: DropIndexes for SQL Server 2016 & Newer CREATE OR ALTER PROCEDURE dbo.DropIndexes @SchemaName NVARCHAR(255) = 'dbo', @TableName...
🌐
Quora
quora.com › How-do-I-drop-an-index-on-a-SQL-server
How to drop an index on a SQL server - Quora
Answer (1 of 3): Use DROP INDEX statement DROP INDEX (Transact-SQL) - SQL Server
🌐
Microsoft Learn
learn.microsoft.com › en-us › sql › t-sql › statements › drop-index-selective-xml-indexes
DROP INDEX (Selective XML Indexes) - SQL Server | Microsoft Learn
November 18, 2025 - Applies to: SQL Server Azure SQL Database Azure SQL Managed Instance SQL database in Microsoft Fabric · Drops an existing selective XML index or secondary selective XML index in SQL Server.
🌐
Lokesh
lokesh.me › sql-server-dropping-indexes-in-production-env
SQL Server: Dropping Indexes in production (safely) - Lokesh Devnani | Musings and Ramblings
June 3, 2021 - We analyzed and compiled a list of unused indexes in our SQL database in Part one of removing unused indexes from SQL server. So, let’s just run the DROP INDEX query and be done with it.
🌐
DevArt
blog.devart.com › home › products › sql server tools › sql drop index statement with syntax, examples
SQL DROP INDEX Statement: Syntax, Examples
May 5, 2025 - It’s just like DROP TABLE IF EXISTS, but instead of checking for a table, it checks for the index. If the index isn’t there, the command simply does nothing. Here’s the syntax: ... Unfortunately, if you’re using an older version of SQL Server, you won’t have the IF EXISTS clause, so you’ll need to handle potential errors another way.
🌐
Experts Exchange
experts-exchange.com › questions › 29295294 › Dropping-index.html
Dropping index | Experts Exchange
October 18, 2025 - It is usually blocking or waiting on dependencies, so run the drop during low traffic after checking and clearing blockers, remove dependent objects, and use your engine’s nonblocking option where available. This question needs an answer! Looks like this question is still being worked on. Think you can help? Create your account and start contributing! ... EARN REWARDS FOR ASKING, ANSWERING, AND MORE. Earn free swag for participating on the platform. ... Microsoft SQL Server is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.SQL Server is available in multiple versions, typically identified by release year, and versions are subdivided into editions to distinguish between product functionality.
🌐
W3Schools
w3schools.com › sql › sql_delete.asp
SQL DELETE Statement
ADD ADD CONSTRAINT ALL ALTER ALTER COLUMN ALTER TABLE ALTER VIEW AND ANY AS ASC BACKUP DATABASE BETWEEN CASE CHECK COLUMN CONSTRAINT CREATE CREATE DATABASE CREATE INDEX CREATE OR REPLACE VIEW CREATE TABLE CREATE PROCEDURE CREATE UNIQUE INDEX CREATE VIEW DATABASE DEFAULT DELETE DESC DISTINCT DROP DROP COLUMN DROP CONSTRAINT DROP DATABASE DROP DEFAULT DROP INDEX DROP TABLE DROP VIEW EXEC EXISTS FOREIGN KEY FROM FULL OUTER JOIN GROUP BY HAVING IN INDEX INNER JOIN INSERT INTO INSERT INTO SELECT IS NULL IS NOT NULL JOIN LEFT JOIN LIKE LIMIT NOT NOT NULL OR ORDER BY OUTER JOIN PRIMARY KEY PROCEDURE RIGHT JOIN ROWNUM SELECT SELECT DISTINCT SELECT INTO SELECT TOP SET TABLE TOP TRUNCATE TABLE UNION UNION ALL UNIQUE UPDATE VALUES VIEW WHERE MySQL Functions
🌐
RazorSQL
razorsql.com › docs › sqlserver_drop_index.html
MS SQL Server Drop Index
The MS SQL Server Drop Index Tool allows users to select a Index to be dropped.