SET @test = NULL;
— Returns 0 in SQL 2012, and 1 in earlier editions
SELECT COUNT(1) WHERE @test.exist(‘/whatever’) = 0;
— Returns 1 in all editions
SELECT COUNT(1) WHERE @test.exist(‘/whatever’) IS NULL;
The first query returns 1 in previous editions, while according to other NULL comparisons in SQL Server 0 is expected. This behavior is more consistent than in previous versions.