Does the SQL Server CASE statement evaluate all the WHEN conditions or does it exit once it finds a WHEN that evaluates to true? If it does go thru the entire set of conditions does that mean that the last condition evaluating to true overwrites what the first condition that evaluated to true did? For example:
SELECT Case when 1+1 = 2 then 'YES' when 1+1 = 3 then 'NO' when 1+1 = 2 then 'NO' END
The results is "YES" even though the last when condition should make it evaluate to "NO" so it seems that it exits once it finds the first TRUE condition. Can someone please confirm if this is the case.