--- title: "ALTER INDEX (Transact-SQL)" description: Modifies an existing table or view index (rowstore, columnstore, or XML) by disabling, rebuilding, or reorganizing the index; or by setting options on the index. author: rwestMSFT ms.author: randolphwest ms.reviewer: wiassaf, randolphwest, dfurman ms.date: 02/28/2025 ms.service: sql ms.subservice: t-sql ms.topic: reference ms.custom: - ignite-2024 f1_keywords: - "ALTER INDEX" - "ALTER_INDEX_TSQL" helpviewer_keywords: - "indexes [SQL Server], reorganizing" - "ALTER INDEX statement" - "indexes [SQL Server], disabling" - "online index operations" - "index reorganization [SQL Server]" - "ALLOW_ROW_LOCKS option" - "ALL keyword" - "reorganizing indexes" - "constraints [SQL Server], indexes" - "row locks [SQL Server]" - "index rebuilding [SQL Server]" - "rebuilding indexes" - "locking [SQL Server], indexes" - "partitioned indexes [SQL Server], rebuilding" - "defragmenting indexes" - "disabling indexes" - "XML indexes [SQL Server], modifying" - "index modifications [SQL Server]" - "indexes [SQL Server], modifying" - "index options [SQL Server]" - "modifying indexes" - "index disabling [SQL Server]" - "MAXDOP index option, ALTER INDEX statement" - "spatial indexes [SQL Server], modifying" - "indexes [SQL Server], options" - "ALLOW_PAGE_LOCKS option" - "page locks [SQL Server]" - "index rebuild [SQL Server]" - "index reorganize [SQL Server]" dev_langs: - "TSQL" monikerRange: ">=aps-pdw-2016 || =azuresqldb-current || =azure-sqldw-latest || >=sql-server-2016 || >=sql-server-linux-2017 || =azuresqldb-mi-current || =fabric" --- # ALTER INDEX (Transact-SQL) [!INCLUDE [SQL Server Azure SQL Database Azure SQL Managed Instance Azure Synapse Analytics PDW FabricSQLDB](../../includes/applies-to-version/sql-asdb-asdbmi-asa-pdw-fabricsqldb.md)] Modifies an existing table or view index (rowstore, columnstore, or XML) by disabling, rebuilding, or reorganizing the index; or by setting options on the index. :::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: [Transact-SQL syntax conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md) ## Syntax Syntax for SQL Server, Azure SQL Database, and Azure SQL Managed Instance. ```syntaxsql ALTER INDEX { index_name | ALL } ON { REBUILD { [ PARTITION = ALL [ WITH ( [ , ...n ] ) ] ] | [ PARTITION = partition_number [ WITH ( [ , ...n ] ) ] ] } | DISABLE | REORGANIZE [ PARTITION = partition_number ] [ WITH ( ) ] | SET ( [ , ...n ] ) | RESUME [ WITH ( [ , ...n ] ) ] | PAUSE | ABORT } [ ; ] ::= { { database_name.schema_name.table_or_view_name | schema_name.table_or_view_name | table_or_view_name } } ::= { PAD_INDEX = { ON | OFF } | FILLFACTOR = fillfactor | SORT_IN_TEMPDB = { ON | OFF } | IGNORE_DUP_KEY = { ON | OFF } | STATISTICS_NORECOMPUTE = { ON | OFF } | STATISTICS_INCREMENTAL = { ON | OFF } | ONLINE = { ON [ ( ) ] | OFF } | RESUMABLE = { ON | OFF } | MAX_DURATION =