Adsense_01

Thursday, 7 January 2010

Sparse Columns

This is a new feature available to support the columns with the NULL values. Any column having NULL values having sparse column enabled will decrease the file size but enabling this feature other than NULL value columns will increase the file size. So be cautious while enabling this option.

This option can be enabled using GUI or T-SQL code. By editing an existing table and select the Is Sparse option in the Column Properties which can be seen in the below screen.

SPARSE_Column

The same can be achieved using the following T-SQL.

CREATE TABLE dbo.Table
(
Column 1 int NULL,
Column2 varchar(30) SPARSE NULL
) ON [PRIMARY]
GO

No comments:

Post a Comment