Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Blastrix
Posting Yak Master
208 Posts |
Posted - 2001-12-19 : 23:28:11
|
| I'm curious about something. In my database designs I try not to incorporate any NULLs whatsoever. I have read a great deal about how bad they are. But there are a few areas I'm not sure about. For instance, when a row has a datetime field but the dateTime field is maybe not used right away. But using some type of magic value doesn't really seem appropriate. Is this a situation where I should rethink my DB design or is using a NULL in this instance okay? |
|
|
Nazim
A custom title
1408 Posts |
Posted - 2001-12-19 : 23:42:00
|
| IMHO for this kind of situation its absolutely ok. you can always work with your records basing upon null's upon missing value, there are other approaches too. for instance people keep an arbitarary value say '01-Jan-1900' for date or 99999.99 for numeric value or something like that to deduce a missing value . but you have to be sure these values will not occur in your original data. -------------------------"Success is when Preparedness meets Opportunity" |
 |
|
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2001-12-19 : 23:42:13
|
That is a contentious issue I would go with a NULL, I don't have a problem with them.Otherwise with dates, in SQL Server if you pass a blank value to them they will evaluate as 1-1-1900 or something, so maybe that is a possibility.Damian |
 |
|
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2001-12-19 : 23:43:05
|
Damn, beaten by 13 seconds .... oh well Damian |
 |
|
|
Blastrix
Posting Yak Master
208 Posts |
Posted - 2001-12-20 : 00:02:03
|
| Thanks for the help guys. |
 |
|
|
byrmol
Shed Building SQL Farmer
1591 Posts |
Posted - 2001-12-20 : 00:49:47
|
| I like your thinking Blastrix.A NULL wouldn't be so bad here but a more "theoritcal" (Don't hit me anyone!) approach would be to make a one-to-one relationship.That way you can use EXISTS instead of IS NULL.Of course it will be slower but that is the price you pay for avoiding a NULL or dodgy date in this scenario.DavidM"Why are you crying?""Because I love a Microsoft product" |
 |
|
|
Nazim
A custom title
1408 Posts |
Posted - 2001-12-20 : 00:51:48
|
David how will a Exist help in this kinda scenario. yeah as u told it can ONLY give you time overhead. dont you think so??Yeah Merkin isnt Sqlteam a game of Rat Race . Every second counts here , some1 told me 13 isnt a lucky 1, atleast for u -------------------------"Success is when Preparedness meets Opportunity"Edited by - Nazim on 12/20/2001 00:56:29 |
 |
|
|
|
|
|