ANSI_NULLS

  • Comments posted to this topic are about the item ANSI_NULLS

  • Good question and reminder, thanks

    ...

  • This was removed by the editor as SPAM

  • The answer "it's confusing" should be correct as well 😀

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Koen Verbeeck (3/15/2016)


    The answer "it's confusing" should be correct as well 😀

    +1

  • We still have it, well, pretty much everywhere, but always ON (I think).

  • Koen Verbeeck (3/15/2016)


    The answer "it's confusing" should be correct as well 😀

    Agreed.

  • While answer #4 is a true statement (and so is #1, as others have mentioned), it doesn't really answer the question.

    WHY should you not set ANSI_NULLS to OFF?

    Because SET ANSI_NULLS OFF tells SQL Server to behave in a non-standard manner.

    Because SET ANSI_NULLS OFF in one batch doesn't guarantee it will be OFF in another batch, leading to a high risk of inconsistent behavior.

    Because SET ANSI_NULLS OFF will prevent you from creating or changing indexes on computed columns or indexed views.

    Because SET ANSI_NULLS OFF will prevent the query optimizer from using indexes on computed columns or indexed views.

    Because SET ANSI_NULLS OFF was a compatibility setting to save developers from having to immediately refactor their code bases decades ago. If you haven't worked through that code base by now, you're not maintaining it properly.

  • Koen Verbeeck (3/15/2016)


    The answer "it's confusing" should be correct as well 😀

  • And here I first read the question "Why should you set" instead of "Why should you not set" the first time. 😛 Funny thing is that I don't miss NOTs in code.

Viewing 10 posts - 1 through 9 (of 9 total)

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