• If the SELECT statement returns no rows, the variable retains its present value. If expression is a scalar subquery that returns no value, the variable is set to NULL.

    That isn't true.

    Count() return 0

    create table xxx (i int identity, a varchar(3))

    go

    declare @txt varchar(255)set @txt = 'Question'

    select @txt = count(1) from xxx order by 1

    insert xxx values ('of')insert xxx values ('the')insert xxx values ('day')

    select @txt = @txt + ' ' + a from xxx order by i

    select @txt