Article ID: 175359 - Last Review: March 14, 2006 - Revision: 4.0 FIX: Force Index Option Fails with Temporary Tables in Stored ProceduresThis article was previously published under Q175359
BUG #:
16815 (6.5)
9986 (6.0)
SYMPTOMS
If the "force index" Optimizer hint is used on a query against a temporary
table, the query may fail with the following error:
Error 308 Severity 16 Index %s on table %s (specified in the from clause) does not exist.
WORKAROUND
The stored procedure runs correctly if you EXEC it in the same batch in
which the stored procedure is created. However, if you execute the stored
procedure from another session, it must be recompiled (as when the server
restarts).
A more permanent workaround is to submit the SELECT statement within the stored procedure by using the SQL Server 6.0 EXEC feature, rather than a straight SELECT. STATUS
Microsoft has confirmed this to be a problem in SQL Server 6.5. This problem has been corrected in Service Pack 5a for Microsoft SQL Server 6.5.For more information, click the following article number to view the article in the Microsoft Knowledge Base: 197177
(http://support.microsoft.com/kb/197177/
)
INF: How to Obtain SQL Server 6.5 Service Pack 5a For more information, contact your primary support provider.
| Article Translations
|

Back to the top
