Friday, March 30, 2012

Saving space by using nulls?

Say that I have 2 identical tables with the only difference that one table
allows nulls on all of its *numeric* columns and the other one does not.
Now say that I add the same amount of rows to both tables with the only
difference that on the table that does not allow nulls in its numeric
columns I insert numeric values while in the one that does allow nulls I
insert <<Null>> value.
Will both tables use the same storage space or would the table that allows
nulls use less space because I am insetting Null values on it?
Thanks
Same. As of 7.0, space requirement for fixed length column is the same regardless if a column of a
row has null or an actual value.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Rene" <nospam@.nospam.com> wrote in message news:%23m6dfC8zFHA.1032@.TK2MSFTNGP12.phx.gbl...
> Say that I have 2 identical tables with the only difference that one table allows nulls on all of
> its *numeric* columns and the other one does not.
> Now say that I add the same amount of rows to both tables with the only difference that on the
> table that does not allow nulls in its numeric columns I insert numeric values while in the one
> that does allow nulls I insert <<Null>> value.
> Will both tables use the same storage space or would the table that allows nulls use less space
> because I am insetting Null values on it?
> Thanks
>
>
|||Thanks Tibor
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:eemuGL8zFHA.1968@.TK2MSFTNGP10.phx.gbl...
> Same. As of 7.0, space requirement for fixed length column is the same
> regardless if a column of a row has null or an actual value.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Rene" <nospam@.nospam.com> wrote in message
> news:%23m6dfC8zFHA.1032@.TK2MSFTNGP12.phx.gbl...
>

No comments:

Post a Comment