--- title: "ALTER INDEX (Transact-SQL) | Microsoft Docs" ms.custom: "" ms.date: "03/07/2017" ms.prod: "sql-non-specified" ms.reviewer: "" ms.suite: "" ms.technology: - "database-engine" ms.tgt_pltfrm: "" ms.topic: "language-reference" f1_keywords: - "ALTER INDEX" - "ALTER_INDEX_TSQL" dev_langs: - "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]" ms.assetid: b796c829-ef3a-405c-a784-48286d4fb2b9 caps.latest.revision: 222 author: "BYHAM" ms.author: "rickbyh" manager: "jhubbard" --- # ALTER INDEX (Transact-SQL) [!INCLUDE[tsql-appliesto-ss2008-all_md](../../includes/tsql-appliesto-ss2008-all-md.md)] Modifies an existing table or view index (relational or XML) by disabling, rebuilding, or reorganizing the index; or by setting options on the index. ![Topic link icon](../../database-engine/configure-windows/media/topic-link.gif "Topic link icon") [Transact-SQL Syntax Conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md) ## Syntax ``` -- Syntax for SQL Server and SQL Database 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 ] . | schema_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 =