Quantcast
Channel: IF ELSE vs CASE WHEN
Viewing all articles
Browse latest Browse all 19

IF ELSE vs CASE WHEN

$
0
0

You should be able to find the information from the definition. 

http://msdn.microsoft.com/en-us/library/ms181765.aspx

You cannot use CASE as a Flow Control method and the CASE eveluates its expression sequentially so it errors in your example.

"The CASE expression cannot be used to control the flow of execution of Transact-SQL statements, statement blocks, user-defined functions, and stored procedures. 

..

The CASE statement evaluates its conditions sequentially and stops with the first condition whose condition is satisfied.

"


Viewing all articles
Browse latest Browse all 19

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>