Dave Burke - Freelance .NET Developer specializing in Online Communities

A freelance .NET Developer

What I thought was a SQL bug

When I hear guys talk about a bug in VS.NET or SQL Server or whatever, I'm always very skeptical.  I never conclude that the MS stuff I've used for years has bugs, but this was one of those times.  I also had the passing thought I had some data corruption, but it would have been the first time that happened with SQL Server since I began using it in 1996 with SQL Server 6.5.

In my app I set a value in, lets say, ThisColumn to 'TBA' (or To Be Assigned.)  At a later stage in the app, via another wizard, the field is changed to NULL to indicate that assignment action was completed.  When I queried the table with “select * from table where ThisColumn <> 'TBA', the rows with NULL in ThisColumn did not appear.  (Hey, the value was NOT 'TBA!'  My problem was that because of the pattern of the data I was working with and what I was looking for, I had thought that only 3 specific rows were not appearing.

It wasn't until just now while reviewing the process for this post 24 hours after the incident did I realize that NO rows with a null value were returned.  Man, I know null values are not retrieved in a string comparison query, but no matter how long I looked at that data it just didn't ring a bell.  That's what I get for doing “work work” at night. 

damned embarrassing.

Posted: Mar 30 2004, 10:15 PM by daveburke | with no comments
Filed under:

Comments

No Comments

Leave a Comment

(required) 

(required) 

(optional)

(required)