Cannot perform the specified operation on disabled index '%.*ls' on %S_MSG '%.*ls'.

Error Message:
Msg 1973, Level 16, State 1, Line 1
Cannot perform the specified operation on disabled index ‘%.*ls’ on %S_MSG ‘%.*ls’.

Severity level:
16.

Description:
This error message appears when you try to perform certain operations on a disabled index.

Consequences:
The T-SQL statement can be parsed, but causes the error at runtime.

Resolution:
Error of the Severity Level 16 are generated by the user and can be fixed by the SQL Server user. The statement cannot be executed this way. You can only perform a few specific operations on a disabled view. For further information refer to the Books Online (BOL).

Versions:
This error message was introduced with SQL Server 2005

Example(s):
USE tempdb;
GO
IF OBJECT_ID(‘tempdb..#t’) > 0
 DROP TABLE #t
GO
CREATE TABLE #t
(
 c1 INT
);
GO
CREATE UNIQUE CLUSTERED INDEX CIX_t_c1 ON #t(c1);
GO
ALTER INDEX CIX_t_c1 ON #t
DISABLE;
GO
ALTER INDEX CIX_t_c1
   ON #t
  SET (
      STATISTICS_NORECOMPUTE = ON,
      IGNORE_DUP_KEY = ON,
      ALLOW_PAGE_LOCKS = ON
      ) ;

Remarks:
In the above example we try to perform the specified SET operation on the disabled index CIX_t_c1. This raises the error.

]]>

Leave a comment

Your email address will not be published.