Index '%.*ls' on table '%.*ls' (specified in the FROM clause) does not exist.

Error Message:
Msg 308, Level 16, State 1, Line 3
Index ‘%.*ls’ on table ‘%.*ls’ (specified in the FROM clause) does not exist.

Severity level:
16.

Description:
This error message appears when you try to force the usage of a non-existing index.

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

Resolution:
Errors 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. The index must exist before it can be used.

Versions:
All versions of SQL Server.

Example(s):
USE tempdb;
GO
CREATE TABLE #t (c1 int);

SELECT
    *
FROM
    #t WITH (INDEX = NonExistingIndex);

DROP TABLE #t;

Remarks:
In the above example we try to force SQL Server to use the index ‘NonExistingIndex’. Because this index does not exist, the error is raised.

]]>

Leave a comment

Your email address will not be published.