September 25, 2018 at 6:44 am
Hi Experts,
We have a column with 136 columns and out of which 21 columns are NULL for the total 65000 rows.
How to find the size taken by these columns which have nothing?
September 25, 2018 at 9:59 am
In google I typed in:
"sql server how much space does a null take up", This was the top result:
https://stackoverflow.com/questions/3731172/how-much-size-null-value-takes-in-sql-server
September 26, 2018 at 12:29 pm
To repeat the answers, same size space for fixed size fields, 0 for variable fields. There's a null bitmap
September 27, 2018 at 1:50 am
Steve Jones - SSC Editor - Wednesday, September 26, 2018 12:29 PMTo repeat the answers, same size space for fixed size fields, 0 for variable fields. There's a null bitmap
Thanks Steve. What about the overhead of 1 byte , i read if we didnt use sparse it takes up some space.
September 27, 2018 at 9:57 am
There is a good explanation here. It's not 0 byte for nulls: https://stackoverflow.com/questions/3793022/how-do-you-get-to-limits-of-8060-bytes-per-row-and-8000-per-varchar-nvarchar/3793265#3793265
The sparse column thing is for fixed width fields, like int, tinyint,etc
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply