SQL Flow Field Guide

DROP INDEX (Selective XML Indexes)

Catalog support for SQL Server 2022 (16.x) and 2025 (17.x)

removes an index; CREATE/ALTER REBUILD sorts and writes all rows of the key

What changes

Input
table or view columns (key, included, filter predicate)
Output or change
index structure (B-tree, columnstore, XML, spatial, JSON, vector, full-text)

Syntax at a glance

DROP INDEX index_name ON <object> [ WITH ( <drop_index_option> [ ,...n ] ) ]

Work example

A selective XML index is removed after its XQuery workload changes.

Check indexed paths, query plans, and any dependent XML index before retirement.

Check your work No required XQuery depends on the removed path and remaining XML indexes still serve their callers.

Open Microsoft Learn for full syntax, permissions, and details for your version.