Re: NULL Changed to Empty String
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Mon, 26 Oct 2009 08:10:25 +0000 (UTC)
Alan Z. Scharf (ascharf@xxxxxxxxxxxxxx) writes:
I have SQL Server 2000 database where what were VARCHAR(200) column
NULL field values changed to empty strings, I.e. the rows are no
longer selectable with 'WHERE FieldName IS NULL', but are selectable
with 'WHERE LEN(FieldName) = 0'.
Is there any kind of circumstance that could cause this?
The column values in the particular rows in question were actually NULL
for four years until this past month.
The client swears they did nothing to this column in the table, although
they did add a couple of new columns to the table and change an existing
one from INT to VARCHAR(200).
If the value was NULL before and is a blank string now, it is because
someone changed it, consciously or inadverntly. SQL Server did not change
the value on a whim. It's as simple as that.
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- Follow-Ups:
- Re: NULL Changed to Empty String
- From: Alan Z. Scharf
- Re: NULL Changed to Empty String
- References:
- NULL Changed to Empty String
- From: Alan Z. Scharf
- NULL Changed to Empty String
- Prev by Date: Re: Insert text containing and '
- Next by Date: Does a text field takes more memory than varchar, even if the data is the same?
- Previous by thread: Re: NULL Changed to Empty String
- Next by thread: Re: NULL Changed to Empty String
- Index(es):
Relevant Pages
|