I agree Mark but I'm supporting a 3rd party app which of course I don't
have the code to so I can't make any structural changes.  

I'm fully aware of the problems nullable columns present.  Even to
somebody like me who is well aware of the issues, I sometimes forget
about a column having null values when writing my queries.

I do like the "As Nullable(Of DateTime)" capabilities we now have.


-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Marc Brooks
Sent: Thursday, September 06, 2007 11:59 AM
To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
Subject: Re: [ADVANCED-DOTNET] Null dates in 2005

> I've always done something like below to handle dates that can be null
> in the DB.  Was curious if they (MS) every got around to coming up
with
> a date data-type that can accept null values.  Is there a better way?

Don't use NULL dates... it makes all the SQL prone to errors (since
comparing anything against NULL is false). Rather, decide what
sentinal date value "represents" not-known in the database an use
that... for example, use 9999-12-31 23:59:59.997 as the sentinal for
date of death and you'll never blow a "is he allive" query...

Another voice:
http://weblogs.sqlteam.com/mladenp/archive/2007/03/14/60134.aspx

--
"Any man who carries a hyphen with him carries a dagger that he is
ready to plunge into the vitals of this Republic whenever he gets
ready." Woodrow Wilson

Marc C. Brooks
http://musingmarc.blogspot.com

===================================
This list is hosted by DevelopMentor  http://www.develop.com

View archives and manage your subscription(s) at
http://discuss.develop.com

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to