declare@nullvarchar(1); set@null=null; if (@nullisnull) begin print'is null always works not matter "ANSI_NULLS" variable '; end set ANSI_NULLS OFF if (@null=null) begin print'= null works when "ANSI_NULLS" = OFF only'; end set ANSI_NULLS ON ifnotexists(select1where@null=null) begin print'= null not works when "ANSI_NULLS" <> OFF'; end