• I'm proud of my wrong answer ("NULL") as it shows I thought it through, even if incorrectly, before triying the script in SSMS. <rant on> I can't imagine that 85% of respondants actualy knew the result of the SELECT .... where the condition is false would not be assigned to the variable. </rant>

    Meanwhile, for those interested in seeing this behavior in SSMS....

    DECLARE @i INT

    SELECT @i = 0

    SELECT @i AS i--Returns 0

    SELECT @i = 1 where 1=0--Null; assignment ignored

    SELECT @i AS i--Returns 0

    SELECT @i = (SELECT 2 where 1=0)--Assign result of subSelect with FALSE condition ***

    SELECT @i AS i--Returns NULL

    SELECT @i =3 where 1=1--Condition is true, so assignment works

    SELECT @i AS i--Returns 3

    SELECT @i = (SELECT 4 where 1=1)--Assign result of subSelect with TRUE condition ***

    SELECT @i AS i--Returns 4