Re: When is a NULL Not a NULL ?
- From: "Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
- Date: Wed, 26 Jul 2006 10:28:59 -0400
« "All in all Nulls are a pain and SQL and the products only make it worse.
I would always *try* to avoid them, Nulls that is (g), with careful database
design. The way they are implemented from product to product and from
version to version could easily vary. This, markers idea, was a mistake by
Codd, IMHO, and the vendors and ANSI jumped on it and we seem to be stuck
with it for now." »
This is a big statement and we often read something similar to this, written
in one way or another. However, there is absolutely no example, proof or
demonstration behind it to back it or to substantiate it. When you want to
write a statement about something, you must come with a least a little more
in order to support it.
I could give you a lot of examples where the use of NULL leads to a clearer
code, with less fuss and easier to read. However, I won't because this is a
case where personal experience is more important than dogmatic statements.
NULL is like any other tools, you must learn how to use it properly and if
you want don't know about it or don't want to use it, that's your problem,
not the other's.
In my case, I like to have more tools in my toolbox, not less: when the only
tool you have in your toolbox is an hammer, everything else looks like a
nail and inversely, when all you have to do is to hit a nail, every tool
begins to look like a hammer.
--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: http://cerbermail.com/?QugbLEWINF
"Craig Alexander Morrison" <cam@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:OGUv56JsGHA.4612@xxxxxxxxxxxxxxxxxxxxxxx
When you said that NULLs "represent" unknown
you are speaking only of a convention among SQL users.
No I am not Unknown or Missing information is a topic of debate in R and
that is where I am coming from.
To quote from me 12 years ago:
"All in all Nulls are a pain and SQL and the products only make it worse.
I would always *try* to avoid them, Nulls that is (g), with careful
database design. The way they are implemented from product to product and
from version to version could easily vary. This, markers idea, was a
mistake by Codd, IMHO, and the vendors and ANSI jumped on it and we seem
to be stuck with it for now.
The work of Date (Default Values) with Pascal (Triggered Procedures),
McGovern (Catalog and DB Design) is the latest thinking on the replacement
for Nulls so that missing information can be better represented."
--
Slainte
Craig Alexander Morrison
Crawbridge Data (Scotland) Limited
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@xxxxxxx> wrote in message
news:1153909048.138880.293790@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Craig Alexander Morrison wrote:
Unknown does not equal Unknown.
Not so in math, logic and everyday experience (X = X). My point was
simply that SQL's NULL is not a good model for the reality and logic of
something that is unknown. When you said that NULLs "represent" unknown
you are speaking only of a convention among SQL users. It's a very
unfortunate convention because it leads to so many mistakes of the kind
mentioned.
Null is not a value
Exactly so. Which is why it's inaccurate (or at least potentially
misleading) to say that "NULL represents unknown".
--
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--
.
- Follow-Ups:
- Re: When is a NULL Not a NULL ?
- From: Craig Alexander Morrison
- Re: When is a NULL Not a NULL ?
- From: David Portas
- Re: When is a NULL Not a NULL ?
- References:
- When is a NULL Not a NULL ?
- From: Altemir
- Re: When is a NULL Not a NULL ?
- From: Craig Alexander Morrison
- Re: When is a NULL Not a NULL ?
- From: David Portas
- Re: When is a NULL Not a NULL ?
- From: Craig Alexander Morrison
- Re: When is a NULL Not a NULL ?
- From: David Portas
- Re: When is a NULL Not a NULL ?
- From: Craig Alexander Morrison
- When is a NULL Not a NULL ?
- Prev by Date: Re: Access 2003 and SQL server express 2005
- Next by Date: Re: When is a NULL Not a NULL ?
- Previous by thread: Re: When is a NULL Not a NULL ?
- Next by thread: Re: When is a NULL Not a NULL ?
- Index(es):
Relevant Pages
|