About Me

My photo
Northglenn, Colorado, United States
I'm primarily a BI Developer on the Microsoft stack. I do sometimes touch upon other Microsoft stacks ( web development, application development, and sql server development).

Thursday, January 16, 2014

IIF vs CASE in SQL SERVER 2012

I've been told that behind the scenes, SQL Server 2012 converts IIF to CASE expressions. I didn't think that there wouldn't be that much of a performance issue. What I found in one of my queries is that if I ran the IIF first then the CASE statement. Each time I ran the IIF statement it ranged from 40 - 60 in the client processing time; meanwhile, the CASE expression would run in 10 - 30.

(Click on images to expand)





 

No comments: