Records With NULL in Column Not Being Returning

  • Hi!

    I'm running a stored procedure

    Select RecID FROM tblRecs WHERE RecType <> 'xxx'

    This returns 5 records

    If I run the following

    Select RecID FROM tblRecs WHERE RecType IS NULL

    I get 200 records.

    Why am I not getting the 200 null records in the first sp?  I thought that the WHERE clause RecType <> 'xxx' should include records with RecType being a NULL value?

    The database has ANSI NULL DEFAULT = TRUE AND ANSI nulls enabled = TRUE, but I;m not clear on how these work.  I'll check out BOL for more on these two.

    Thanks!

  • read this article it will help you understand

    http://www.sqlservercentral.com/columnists/mcoles/fourrulesfornulls.asp


    Everything you can imagine is real.

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

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