Sunday, 28 June 2015

How to Disable and Enable Index in SQL Server

To disable an index in SQL Server use the following command:
USE Database_Name
GO
ALTER INDEX Index_Name ON Table_Name DISABLE;
GO

To enable a disabled index, use the following command (REBUILD enables a disabled index):
USE Database_Name
GO
ALTER INDEX Index_Name ON Table_Name REBUILD;
GO

No comments:

Post a Comment