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

alter_index_disable

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

alter_index_rebuild

There is no ENABLE argument in the ALTER INDEX command:

alter_index_enable

Msg 102, Level 15, State 1, Line 1
Incorrect syntax near 'ENABLE'.

If the post helped you, please share it:
Pin It

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">