Symptoms
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.
In this scenario, you may receive incorrect results from the procedure that is run on your connection if the following additional conditions are met during the time interval that occurs between the end of query compilation and the start of query execution on your connection:
-
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.
Important This timing issue is extremely rare.
Cause
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.
Resolution
The issue was first fixed in the following cumulative update of SQL Server.
Cumulative Update 4 for SQL Server 2014 /en-us/help/2999197
Cumulative Update 2 for SQL Server 2012 SP2 /en-us/help/2983175
Cumulative Update 11 for SQL Server 2012 SP1 /en-us/help/2975396
Each new cumulative update for SQL Server contains all the hotfixes and all the security fixes that were included with the previous cumulative update. Check out the latest cumulative updates for SQL Server:
Status
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.