• I find the variable assignment rather interesting in that it seems to occur at a curious point. To see what happened when there is a null value, I tried:

    declare @txt varchar(255)

    set @txt = 'Question'

    insert xxx values ('')

    select @txt = isnull (a, '?') from xxx order by i

    and got a null string and not "?" as I was expecting.

    Does you know why? It seems to me that the variable assignment occurs at a rather odd place in the execution of the statement.