• I enjoyed this article, good description of problem solving exercise.

    But I don't think the title or any focus on isnull() is right. 

    Assume some other function was used instead of isnull--maybe upper() for the sake of argument.  Still would have had same problem with truncation.  The problem was with variable declaration & fact that escaping process expanded size of string. 

    I've seen more problems related to isnull() or lack of it than almost any other single area, but this is not one of them.