5

If there are multiple connections concurrently executing a query with different parameters in a filter condition and the WITH RECOMPILE option is used, is there any chance that the query may produce incorrect results?

closed as off-topic by Paul White, ypercubeᵀᴹ, RLF, RolandoMySQLDBA, Mark Storey-Smith Oct 30 '14 at 20:18

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Too localized - this could be because your code has a typo, basic error, or is not relevant to most of our audience. Consider revising your question so that it appeals to a broader audience. As it stands, the question is unlikely to help other users (regarding typo questions, see this meta question for background)." – Paul White, ypercubeᵀᴹ, RLF, RolandoMySQLDBA, Mark Storey-Smith
If this question can be reworded to fit the rules in the help center, please edit the question.

6

This ought not happen, but there have been several bugs that mean it might, depending on your version of SQL Server, and which patches you have applied.

The relevant Microsoft KB articles are listed below:

FIX: Incorrect result when you execute a query that uses WITH RECOMPILE option in SQL Server 2012 or SQL Server 2014

FIX: A query that uses parameters and the RECOMPILE option returns incorrect results when you run the query in multiple connections concurrently in SQL Server 2008

FIX: Different results may be returned when you concurrently run the same query with the RECOMPILE option in SQL Server 2008

Not the answer you're looking for? Browse other questions tagged or ask your own question.