The example illustrates the computations on a table that contains 9,000,000 rows:

The sum of fixed-length column sizes is 100 bytes.

The sum of variable-length column sizes is 50 bytes; there are 2 variable-length columns.

The table has two indexes:

A clustered index, on a fixed-length column, of 4 bytes

A composite nonclustered index with these columns:

A fixed length column, of 4 bytes

A variable length column, of 20 bytes

Different formulas are needed for allpages-locked and data-only-locked tables, since they have different amounts of overhead on the page and per row:

See “Calculating table and clustered index sizes for allpages-locked tables” for tables that use allpages-locking.

See “Calculating the sizes of data-only-locked tables” for the formulas to use if tables that use data-only locking.