Richard Warr (11/16/2010)
I thought it was an interesting question as well - currently more people have it wrong than right which shows that we can still be surprised at the "behind the scenes" antics of SQL Server.
More people may have it wrong than right but its got less to do with the "behind the scenes" antics of SQL Server
and more to do with the traps deliberately put into the question.
I've seen this problem before, and resolved it by seperating the CASE statement as suggested previously... however the traps set in the question tripped me up in this case.
_____________________________________________________________________"The difficult tasks we do immediately, the impossible takes a little longer"