SQL Server Performance, DBA Best Practices & Enterprise Data Solutions | MyTechMantra
Home » SQL Server » How to Enable an Index in SQL Server

How to Enable an Index in SQL Server

In this article we will take a look at how to enable an index in SQL Server. This is a very useful feature which will help you enable an index which was disabled earlier to check whether the index was really useful or not without actually dropping the index. 

How to verify whether an index is disabled or not in SQL Server?

Execute the below TSQL script to verify whether the index is disabled or not in SQL Server.

/* verify whether the Index is Disabled or Not? */
SELECT	  name AS [Index Name]
		, type_desc AS [Index Type]
		, index_id AS [Index ID]
		, CASE IS_DISABLED
				WHEN 0 THEN 'Enabled'
				ELSE 'Disabled'
			END AS [Index Usage]
		, FILL_FACTOR AS [Fill Factor]
FROM SYS.INDEXES
WHERE OBJECT_ID = OBJECT_ID('Sales.Customer')
	ORDER BY 2 
GO
How to Check whether the index is disabled or not in SQL Server
How to Check whether the index is disabled or not in SQL Server

How to Rebuild Index in SQL Server?

There are different ways in which you can rebuild the index in SQL Server. However the easiest method will be to execute ALTER INDEX REBUILD statement to rebuild an index or execute CREATE INDEX WITH DROP_EXISTING statement to enable a disabled index. In the below demo I will use Sales.Customer table which is available in AdventureWorks2008R2 sample database. For more information see, How to Disable an Index in SQL Server.

Different Ways to Enable an Index in SQL Server

  • Enable an Index Using ALTER INDEX…REBUILD Statement
  • Enable an Index Using CREATE INDEX WITH DROP_EXISTING Statement
  • Enable an Index in SQL Server Using SQL Server Management Studio (SSMS)

Let’s get started and learn in detail different options available to enable an index in SQL Server.

1. Connect to Database Instance Using SQL Server Management Studio (SSMS)

2. Expand Databases -> Expand AdventureWorks2008R2 database -> Expand Tables -> Expand Sales.Customer table -> Expand Indexes and the right click the index which you want to enable and click Rebuild.

How to Rebuild an Index in SQL Server
How to Rebuild an Index in SQL Server

3. This will open up Rebuild Indexes popup as shown in the snippet below.

Rebuild Index in SQL Server Using SSMS
Rebuild Index in SQL Server Using SSMS

4. Finally, click OK to Rebuild the index which was disable before.

How to Enable an Index Using ALTER INDEX…REBUILD Statement?

To enable an index in SQL Server execute the below mentioned TSQL script which will enable IX_Customer_TerritoryID index of Sales.Customer table which is available in AdventureWorks2008R2 sample database.

USE [AdventureWorks2008R2]
GO

ALTER INDEX [IX_Customer_TerritoryID] ON [Sales].[Customer] REBUILD 
GO

How to Enable an Index in SQL Server Using CREATE INDEX WITH DROP_EXISTING Statement?

To enable an index in SQL Server execute the below TSQL script which will enable IX_Customer_TerritoryIDindex of Sales.Customer table which is available in AdventureWorks2008R2 sample database.

USE [AdventureWorks2008R2] 
GO 

CREATE NONCLUSTERED INDEX [IX_Customer_TerritoryID] ON [Sales].[Customer]
(
[TerritoryID] ASC
)
WITH (DROP_EXISTING = ON,
FILLFACTOR = 90) 
GO

Trending Articles

Ashish Kumar Mehta

Ashish Kumar Mehta is a distinguished Database Architect, Manager, and Technical Author with over two decades of hands-on IT experience. A recognized expert in the SQL Server ecosystem, Ashish’s expertise spans the entire evolution of the platform—from SQL Server 2000 to the cutting-edge SQL Server 2025.

Throughout his career, Ashish has authored 500+ technical articles across leading technology portals, establishing himself as a global voice in Database Administration (DBA), performance tuning, and cloud-native database modernization. His deep technical mastery extends beyond on-premises environments into the cloud, with a specialized focus on Google Cloud (GCP), AWS, and PostgreSQL.

As a consultant and project lead, he has architected and delivered high-stakes database infrastructure, data warehousing, and global migration projects for industry giants, including Microsoft, Hewlett-Packard (HP), Cognizant, and Centrica PLC (UK) / British Gas.

Ashish holds a degree in Computer Science Engineering and maintains an elite tier of industry certifications, including MCITP (Database Administrator), MCDBA (SQL Server 2000), and MCTS. His unique "Mantra" approach to technical training and documentation continues to help thousands of DBAs worldwide navigate the complexities of modern database management.

Follow us

Don't be shy, get in touch. We love meeting interesting people and making new friends.