Critical bug with SQL Server 2008 - Queries may display wrong results

Critical bug with SQL Server 2008 - Queries may display wrong results

  
Symptoms

You are running SQL Server 2008 RTM. When running a query (simple/advanced) with some conditions, you get more results than expected. Also, when actually profiling SQL Server, you see that the query is being correctly generated, but the resultset includes results that do not belong there.


Cause
You are being affected by a bug in SQL Server 2008:

Resolution

Apply the fix, or preferably any of the Cumulative uUpdates / Service Packs that fix it (and with that fix other bugs with SQL Server 2008). At the time of writing, Service Pack 2 for SQL Server 2008 is available, so you should at least apply that.

As always, make sure to have the same versions and updates of SQL Server 2008 (and other software) in all staging environments, to make it easier to troubleshoot any problem you might run into.