Weird results when using is null in a select.

  • I have an SQL Server running 2000 with sp3.

    I am querying a table that contains a column of datatype nvarchar(60)and can contain null values.

    When i run a select * from table_name where column_name is null. I am getting back results that are much higher than what they should be. (ie. I should have 2 million rows returned and I am getting 7 million.) When I run not is null the results come back without a problem. Anyone else seen this?

    Some more background.

    I had a dev server with a copy of the same database that is on my prod server. The server was running sp2. It ran fine. When I applied sp3, my query began returning the same wrong results as my prod server did.

    Very Strange....

    Rob DeMotsis

    Sr. SQL Server DBA


    Rob DeMotsis
    Sr. SQL Server DBA

  • DId you check the data for non-null values. If so and you can reproduce then I would check with MS KB site and MS directly. ALso did you try other datatypes to see if the datatype is the key issue?

  • Yep. I checked for non-null values and my results were good. I just found a document (KB814509) that speaks of a bug with the is null clause in a where statement. I am going to try upgraded to sp3a and see if that fixes it. If not, it's on to the SQL Server support desk for me this afternoon.

    Rob DeMotsis

    Sr. SQL Server DBA


    Rob DeMotsis
    Sr. SQL Server DBA

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

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