Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Null
Message
De
04/06/2009 11:49:33
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
 
 
À
04/06/2009 11:46:11
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Titre:
Re: Null
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01403676
Message ID:
01403704
Vues:
45
>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.

OK.
Very fitting: http://xkcd.com/386/
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform