performance - SQL Server Is zero value 0.00 preferable then NULL? -
just general question. better database keep values or nulls?
i have commission field calculates every day , based on total amount value condition. next date commission calculates on previous 1 , sums total value. commission can 0.00 not negative. better keep 0 values or fill them nulls , use 'isnull(comm, 0)' in queries rather 'comm'?
which better performance , db capacity?
upd: performance good. wonder if there storage capacity difference when have hundreds of users records each day? null empty empty or takes bytes when storage value of 0.00 less null itself.
if commission value 0, should keep 0 ,not null. why want call isnull
function convert 0 again ? wrong , makes future programmer going handle code , sit , think 2 days why designed so.
keep simple , clean. use 0.
from msdn,
a value of null indicates value unknown. value of null different empty or 0 value.
Comments
Post a Comment