2

我已阅读此答案,并且已确认 NULL 确实占用了 sql server 2005 中的空间。这在 sql server 2012 中是否发生了变化。NULL 是否占用 sql server 2012 中的空间?

4

2 回答 2

4

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).

于 2012-08-27T15:42:57.920 回答
1

It does.

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

于 2012-08-27T15:42:22.960 回答