Friday 24 June 2016

How to create a SPARSE columns in SQL SERVER



In This post Let we see how to create a Sparse Columns in SQL SERVER

 A Sparse column is a optimised storage format to store NULL values, we can specify a table column as sparse by SPARSE attribute. 

  •  It greatly reduces the space requirement for your table columns.
  • It doesn't take up any space when the column value contains the NULL.
  • It takes up more space when column contains NON-NULL value
  • It is suitable for only the columns which have storage value NULL in large percentage. 




CREATE TABLE employeetable
(
 id      INT IDENTITY(1,1),
 NAME    VARCHAR(40),
 addres  VARCHAR(200),
 tempaddres VARCHAR(300) SPARSE
            )



From this post you can learn how to create a Sparse columns in Sql Server

No comments:

Post a Comment