SQL Server: 2012 Introduce New Logical Function – IIF

SQL Server 2012 introduced new logical function called “IIF” and I am going to share basic syntax and use of this function.

The main purpose of this function is to check the Boolean condition. If condition is true, it returns a true value, otherwise it returns false value.

Using this function you can validate and return value in a single line of code and don’t require to use IF-ELSE.

The Syntax of IIF:

Example ONE:

Example TWO:

Example THREE:

Example of Nested IIF:

Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.

If you like this post, then please share it with others.
Please follow dbrnd.com, I will share my experience towards the success of Database Research and Development Activity.

I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.

More from dbrnd.com

Leave a Reply

1 Comment on "SQL Server: 2012 Introduce New Logical Function – IIF"

Notify of
Sort by:   newest | oldest | most voted

Hi i am kavin, its my first occasion to commenting anyplace, when i read
this article i thought i could also make comment due to this good piece of