Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 164387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:44:06+00:00 2026-05-11T11:44:06+00:00

In my table, I have a nullable bit column (legacy system…) and another developer

  • 0

In my table, I have a nullable bit column (legacy system…) and another developer recently made a change to a stored procedure to only show values where the bit column was not true (1). Because this is a nullable column, we noticed that if the column was NULL, the record was not being picked up. WHY is this?

Both the other developer and I agree that NULL <> 1… Is this a bug in SQL or was this designed this way? Seems like a design flaw.

Current Code:

(VoidedIndicator <> 1) 

Proposed Fix:

(VoidedIndicator <> 1 OR VoidedIndicator IS NULL) 

Clarification (By Jon Erickson)

VoidedIndicator is a nullable bit field so it can have the following values: NULL, 0, or 1

When a SQL statement is created with a where clause such as (VoidedIndicator <> 1) we only get records returned that have VoidedIndicator == 0, but we were expecting both VoidedIndicator == 0 and VoidedIndicator IS NULL. Why is this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T11:44:07+00:00Added an answer on May 11, 2026 at 11:44 am

    From the Wikipedia entry on NULL:

    For example, a WHERE clause or conditional statement might compare a column’s value with a constant. It is often incorrectly assumed that a missing value would be "less than" or "not equal to" a constant if that field contains Null, but, in fact, such expressions return Unknown. An example is below:

    -- Rows where num is NULL will not be returned, -- contrary to many users' expectations. SELECT * FROM sometable WHERE num <> 1;                  

    Basically, any comparison between NULL and something else, whether it’s with = or <> will not be true.

    As another reference, the MSDN T-SQL page on <> states:

    Compares two expressions (a comparison operator). When you compare nonnull expressions, the result is TRUE if the left operand is not equal to the right operand; otherwise, the result is FALSE. If either or both operands are NULL, see SET ANSI_NULLS (Transact-SQL).

    The SET ANSI_NULLS page then states:

    When SET ANSI_NULLS is ON, a SELECT statement that uses WHERE column_name = NULL returns zero rows even if there are null values in column_name. A SELECT statement that uses WHERE column_name <> NULL returns zero rows even if there are nonnull values in column_name.

    …

    When SET ANSI_NULLS is ON, all comparisons against a null value evaluate to UNKNOWN. When SET ANSI_NULLS is OFF, comparisons of all data against a null value evaluate to TRUE if the data value is NULL.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 196k
  • Answers 196k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer After I asked this question, an official (I think?) JavaFX… May 12, 2026 at 7:10 pm
  • Editorial Team
    Editorial Team added an answer date($format, strtotime("$date + 4 hours")); May 12, 2026 at 7:10 pm
  • Editorial Team
    Editorial Team added an answer If you can edit the contents of the iframe (that… May 12, 2026 at 7:10 pm

Related Questions

In my table, I have a nullable bit column (legacy system...) and another developer
I have a nullable DateTime column in my SQL Server 2005 table called DateTimeDeleted.
I am having a problem determining how c# and LINQ solve the common problem
I'm experiencing something a bit strange. I have a table on SQL Server 2008,
I'm working on an ASP.NET project that replaces many existing paper forms. One of

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.