Consider the following scenario:
- You run a procedure in Microsoft SQL Server 2014 or SQL Server 2012.
- The procedure contains a query has the following conditions:
- It joins a table that is updated very frequently.
- It has a WHERE clause that contains parameters.
- It uses Option(Recompile).
- This procedure is run on multiple concurrent connections that have different sets of parameter values.
- Your server is under a heavy load that is causing each of these procedures to take more time than usual.
- Condition 1: Another concurrent connection makes updates to the joined table that are large enough to trigger another recompilation of the query on your connection.
- Condition 2: The same query was recompiled from another connection and then put into cache.
This problem occurs because the parameter values for the query are changed to incorrect values after you run the query on your connection. This occurs because of an extremely rare timing issue that exists between concurrent compilations.
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.