Consider the following scenario:
- You have a stored procedure that creates a temporary table in Microsoft SQL Server.
- You run a query that the stored procedure issues, and the query meets the following conditions:
- The query references to the temporary table that's created by the stored procedure.
- The query has a WHERE clause that's not covered by any indexes, and the missing indexes feature is enabled.
- Assume that the stored procedure is called concurrently from multiple instances. Then the temporary tables are created and dropped frequently, that will lead to frequent creation and deletion of the corresponding records for the missing indexes.
- In this situation, if a pending query of the stored procedure is cancelled, you may receive an access violation error.
The workaround for this issue is to enable the Trace Flag (TF) 2392 which will suppress the collection of missing indexes.
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.