freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
RE: [freetds] Re: Inserting empty strings into MS SQL Server
- 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
-
[freetds] Re: Inserting empty strings into MS SQL Server,
Charles Bearden, 08/09/2004
-
RE: [freetds] Re: Inserting empty strings into MS SQL Server,
Scott Johnson, 08/09/2004
-
RE: [freetds] Re: Inserting empty strings into MS SQL Server,
Joseph Geiser, 08/09/2004
- Re: [freetds] Re: Inserting empty strings into MS SQL Server, Scott Johnson, 08/09/2004
-
RE: [freetds] Re: Inserting empty strings into MS SQL Server,
Joseph Geiser, 08/09/2004
-
Re: [freetds] Re: Inserting empty strings into MS SQL Server,
James K. Lowden, 08/09/2004
- RE: [freetds] Re: Inserting empty strings into MS SQL Server, Joseph Geiser, 08/10/2004
- Re: [freetds] Re: Inserting empty strings into MS SQL Server, Frediano Ziglio, 08/10/2004
- <Possible follow-up(s)>
- RE: [freetds] Re: Inserting empty strings into MS SQL Server, Charles Bearden, 08/09/2004
- RE: [freetds] Re: Inserting empty strings into MS SQL Server, Charles Bearden, 08/10/2004
- RE: [freetds] Re: Inserting empty strings into MS SQL Server, Charles Bearden, 08/10/2004
- RE: [freetds] Re: Inserting empty strings into MS SQL Server, Charles Bearden, 08/10/2004
- RE: [freetds] Re: Inserting empty strings into MS SQL Server, Charles Bearden, 08/10/2004
-
RE: [freetds] Re: Inserting empty strings into MS SQL Server,
Scott Johnson, 08/09/2004
Archive powered by MHonArc 2.6.24.