Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Null
Message
From
04/06/2009 11:46:11
 
 
To
04/06/2009 11:40:16
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
General information
Forum:
Microsoft SQL Server
Category:
Other
Title:
Re: Null
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01403676
Message ID:
01403700
Views:
58
How do you store 0 vs. nothing in a numeric field?

Remember - I said generally speaking. The only time it matters if null is stored in a numeric field is in scenarios similar to storing test grades. If Johnny was absent on the day of the test, his score needs to be null because he presumably is going to make up the test and his score will probably be greater than zero. In this case, I would make the test score field nullable because missing the test is not the same thing as scoring zero on it and I need to make this distinction when averaging Johnny's test scores. In other scenarios, it really doesn't make a difference whether the field contains zero or null and, IMHO, storing zero makes writing the code a lot cleaner.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform