[dba-SQLServer] NULLs

Gustav Brock Gustav at cactus.dk
Sat Mar 14 14:49:37 CDT 2009


Hi Arthur

And what should be substituted for Null values? Zero length strings and "magic" values like -1 or -9999999999 for integers or 9999-12-31 for dates - or the absurd MySQL speciality: 2009-00-00, an invalid date for no date. Makes me feel tired.

/gustav

>>> dwaters at usinternet.com 14-03-2009 17:56 >>>
Hi Arthur,

This argument of 'no nulls ever' is pretty silly.  Most of my design work is
the automation of a business process.  To go from the beginning to the end
could take from a day to a week to a month or more.  People fill in
information whenever they can, and because some fields are optional they
never do get filled in.  So it makes sense to just use a single record in a
table to hold the process' primary information (except for FK's like you
said).

It does NOT make sense to try to force people to work in a way different
than they normally would just to enforce some 'perfection' rule.  Databases
are designed to be able to use nulls - take advantage of that.

Since business processes are not a niche activity, no one should spend any
time at all on a 'no nulls' argument.

Just my 2 cents.

Dan

-----Original Message-----
From: dba-sqlserver-bounces at databaseadvisors.com 
[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Arthur
Fuller
Sent: Saturday, March 14, 2009 11:13 AM
To: Discussion concerning MS SQL Server
Subject: [dba-SQLServer] NULLs

Over on the MySQL group, a discussion has been waging about the use of
NULLs. One guy in particular is adamant about forbidding them everywhere. He
goes so far as to say the existence of NULLs means bad design, pure and
simple. I am not quite so radical about it, but I do look askance at any
column that permits them, and obviously I forbid them in any FK column.

I tossed that in just to take the pulse of this group on this general topic,
but my real question concerns something one of the posters wrote:

"It seems that someone got bitten very hard in a soft area by a Null one
day.
On a more practical level, Oracle recommended to design the table with the
field where NULLs are to be expected at the end of the table, that saves a
little space and two, as the use of indexes is invalidated in case of nulls
its is better to place the important indexed fields toward the beginning of
the table."

I don't know whether this is also true of SQL Server. Do you?

Arthur





More information about the dba-SQLServer mailing list