what behavioual imapacts are seen if IFF is used .

  • hi,

    Q1)please explain "The fact that IIF is translated into CASE also has an impact on other aspects of the behavior of this function"

    following is the link

    "https://docs.microsoft.com/en-us/sql/t-sql/functions/logical-functions-iif-transact-sql"

    q2) what does following mean

     "IIF is remoted to other servers as a semantically equivalent CASE expression, with all the behaviors of a remoted CASE expression."

    Q3) can iff be used only in sqlserver 2012+ and not in other products of sqlserver.

    yours sincerely

  • Q1... IIF is nothing more than a CASE expression with an abbreviated syntax. There is no impact, per se... You can use IIF or the equivalent CASE expression and produce the exact same execution plan. 
    Q2... IIF is just a repackaged CASE expression that allows for the more abbreviated syntax. On the back end, it's just a CASE expression.
    Q3... IIF was introduced in SS2012 and will NOT work in earlier versions.

    The only reason to use IIF, rather than CASE, is if you prefer the abbreviated syntax that it offers... That's it.
    Same goes for the COALESCE expression... Just a rebadged CASE expression that allows for an abbreviated syntax.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply