ANSI_NULLS set to on, what will work?

  • If ANSI_NULLS are set to on, will the following equivalence operators work if equated to a null value?

    IS

    IS NOT

    =

    <>

    I'm assuming that all four of the above are equivalence operators. Please correct me if I am wrong.

  • Why don't you try them and see? Easy to test.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Rowles (2/18/2012)


    If ANSI_NULLS are set to on, will the following equivalence operators work if equated to a null value?

    IS

    IS NOT

    =

    <>

    I'm assuming that all four of the above are equivalence operators. Please correct me if I am wrong.

    The following Books Online entries will help you:

    NULL Comparison Search Conditions

    IS [NOT] NULL (Transact-SQL)

    Null Values

    The behaviour with ANSI_NULLS ON is a lot simpler and more intuitive than with it OFF, and turning this OFF has been deprecated.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply