Luke101
Luke101

Reputation: 65268

Does NULL occupy space on SQL Server 2012

I have read this answer and it has been confirmed that NULL does occupy space in sql server 2005. Has this changed in sql server 2012. Does NULL occupy space in sql server 2012?

Upvotes: 2

Views: 1085

Answers (2)

aF.
aF.

Reputation: 66697

Still the same.

For fixed width fields like nullable int the storage space required is always the same regardless of whether the value is null or not.

For variable width nullable fields the value NULL takes zero bytes of storage space (ignoring the bit to store whether the value is null or not).

Upvotes: 4

GSerg
GSerg

Reputation: 78185

It does.

If you don't want it to, declare the column as SPARSE.

Upvotes: 1

Related Questions