Skip to Content.
Sympa Menu

freetds - RE: [freetds] Re: Inserting empty strings into MS SQL Server

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Charles Bearden" <Charles.F.Bearden AT uth.tmc.edu>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>, "James K. Lowden" <jklowden AT schemamania.org>
  • Cc:
  • Subject: RE: [freetds] Re: Inserting empty strings into MS SQL Server
  • Date: Tue, 10 Aug 2004 11:19:10 -0500

> On Mon, 9 Aug 2004 James K. Lowden wrote:
>
> > Respectfully submitted, I think using zero-length strings to
> > circumvent non-null column policy isn't the best practice.
> > You're really saying there's no data for that column (in this
> > row), so NULL accurately reflects reality. Zero-length strings
> > are very mysterious in ad-hoc queries, because it's hard to see
> > nothing. And some versions of TDS can't distinguish between NULL
> > and a zero-length string, meaning that some clients will see a
> > NULL arriving from a (as declared) non-null column. So, fwiw,
> > I think you're better off making your column nullable. And you
> > get to avoid the bug in the bargain. :-)

Thanks for your response.

I'm not sure what to think. I had been pretty well persuaded that NULLs

and the three-value logic they entail were a bad thing, and frankly that

was after I had come to see them as a big annoyance since they don't
work
with parameter placeholders in WHERE clauses.

Both you and Joe Geiser refer to problems the use of empty strings
instead
of NULLs causes. It may be my lack of experience in RDBMs, but it's not
yet
clear to me exactly what the nature of those problems is. In fact,
others
have told me the same thing about NULLs, namely that they break
relational
models and will reach back and bite you at unexpected times. I do know
that
I find NULLs inconvenient because I can't test for them with the same
operators as I use to test for non-NULL values. Are there some good,
simple
examples of the problems caused by the use of empty strings instead of
NULLs?

> > And some versions of TDS can't distinguish between NULL
> > and a zero-length string, meaning that some clients will see a
> > NULL arriving from a (as declared) non-null column.

This is a bug, right? :-) Or at least a flawed implementation?

Thanks,
Chuck





Archive powered by MHonArc 2.6.24.

Top of Page