INF: Calculating Space for the Storage of NULL Values

Last reviewed: April 25, 1997
Article ID: Q65963

The information in this article applies to:

  - Microsoft SQL Server version 4.2 for OS/2

SUMMARY

This article explains how to calculate the amount of space needed for the storage of NULL values.

MORE INFORMATION

For all standard data types, NULL values stored by Microsoft SQL Server do not take up any additional storage space. The only associated overhead for a column containing a NULL value is a single byte in the storage record that defines a pointer to the column. This is a fixed cost that is associated with the creation of the column. There is a special case for Text/Image storage.

If the columns were created with "nulls allowed," no additional space is allocated for Text and Image columns until data is actually inserted into those columns. However, once a Text or Image column has had data inserted into it, the page space remains allocated even if the column is changed to NULL. The only way to free this allocated page space is to delete the row.


Additional query words:
Keywords : kbusage SSrvServer
Version : 4.2
Platform : OS/2


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 25, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.