DaveWentzel.com            All Things Data

Sparse Columns

 

new feature in 2008.
 
useful on tables where a lot of the column's data is NULL.  Basically with a sparse col the NULL holds no space. 
 
Syntax
CREATE TABLE dbo.Foo (
Bar varchar(2000) SPARSE NULL
);
 
 
What's the tradeoff?
NON NULL entries into the col require an extra 4 bytes of data storage, so you want to use sparse columns in cases where the majority of data is NULL.