Msg 308, Level 16, State 1, Line 3
Index ‘%.*ls’ on table ‘%.*ls’ (specified in the FROM clause) does not exist.
This error message appears when you try to force the usage of a non-existing index.
The T-SQL statement can be parsed, but causes the error at runtime.
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.
All versions of SQL Server.
CREATE TABLE #t (c1 int);
#t WITH (INDEX = NonExistingIndex);
DROP TABLE #t;
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.