• Rune Bivrin (1/10/2017)


    Russell Shilling (1/10/2017)


    The answer is clearly wrong. Some of these questions are really questionable.

    The

    isnull(left(@b,3),'I ô Char') as ba

    will also return the string. The left function of @b-2 returns NULL.

    Well, if you'd run the code you'd find it's completely correct.

    What's missing in the explanation is the behaviour of ISNULL(). It always derives its return type from the first argument, which in the "ba" case will be char(3) as that is what LEFT() will return.

    And for those inquiring minds that would like a quick link for the ISNULL function, https://msdn.microsoft.com/en-us/library/ms184325.aspx.