Using Average Sizes for text/image Data Pages

Each text or image column stores a 16-byte pointer in the data row, with the datatype varchar(16). Each text or image column that is initialized requires at least 2K bytes (1 data page) of storage space.

Text and image columns are designed to store implicit null values, meaning that the text pointer in the data row remains null and there is no text page initialized for the value, saving 2K of storage space.

If a text or image column is defined to allow null values and the row is created with an INSERT statement that includes NULL for the text or image column, the column is not initialized, and the storage is not allocated.

If a text or image column is changed in any way with UPDATE, then the text page is allocated. Of course, inserts or updates that place actual data in a column initialize the page.

The text chains that store text and image data have 112 bytes of overhead per page. Use the following formula to calculate the number of text chain pages that a particular entry will use:

Data length / 1800 = Number of 2K pages

The result should be rounded up in all cases; for example, a data length of 1800 bytes requires two 2K pages.