|
Posted by Erland Sommarskog on 06/01/06 21:16
HandersonVA (handersonva@hotmail.com) writes:
> should I set to "0" as a default value on a quantity and a price field
> or set to "null"?
> if a user enter nothing on the quantity or price field on a web
> browser, should I treat it as null or "0"? I am so confused about this
> concept. please advise me. thank you.
That depends on the business rules. If not entering any price, means
"this item is for free", yes the 0 is the right thing. If not entering
any price means "I don't know", you should use NULL.
The same goes for Quantity. If this is an inventory 0 probably means "out
of stock". Which could be a good default. Then again, it's probably better
to have the user to state that explicitly.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Navigation:
[Reply to this message]
|