Previously I wrote about SQL SERVER - 2008 - Introduction to SPARSE Columns. Let us understand the concept of SPARSE column in more detail. I suggest you read the first part before continuing reading this article.
All SPARSE columns are stored as one XML column in database. Let us see some of the advantage and disadvantage of SPARSE column.
Advantages of SPARSE column are:
- INSERT, UPDATE, and DELETE statements can reference the sparse columns by name. SPARSE column can work as one XML column as well.
- SPARSE column can take advantage of filtered Indexes, where data are filled in the row.
- SPARSE column saves lots of database space when there are zero or null values in database.
Disadvantages of SPARSE column are:
- SPARSE column does not have IDENTITY or ROWGUIDCOL property.
- SPARSE column can not be applied on text, ntext, image, timestamp, geometry, geography or user defined datatypes.
- SPARSE column can not have default value or rule or computed column.
- Clustered index or a unique primary key index can not be applied SPARSE column. SPARSE column can not be part of clustered index key.
- Table containing SPARSE column can have maximum size of 8018 bytes instead of regular 8060 bytes.
- A table operation which involves SPARSE column takes performance hit over regular column.
Let me know your thoughts about SPARSE column feature of SQL Server 2008, I am very eager to see your point of view on this new feature.
Reference : Pinal Dave (http://www.SQLAuthority.com)






[...] UPDATE : Read Advantages and Disadvantages of SPARSE Column SQL SERVER - 2008 - Introduction to SPARSE Columns - Part 2 [...]
SPARSE column can not have default value or rule or computed column.
Only this thing looks odd.Other things are not that much problem
Sorry if this is a naive point!
Now we have the final release of SQl 2008, I have been trying to create a table with more that 1024 columns. I cannot. Even if all columns are defined as ‘int sparse’ I still get a max 1024 col error message.
Any advice would be very welcome.
Hello, Richard
In order to create more than 1024 columns, you have to have a columnset column defined in the table. We explict request this because the client can not retrieve more than 1024 columns, and we do not want people facing the issue of not being to retrieving data. Once the table has columnset defined, the select * will hide all sparse columns, and only see the column set. Neanwhile, people can still select individual sparse columns in their query. The default value of sparse column is NUll, that is the reason why we can not have default or rule on the column
So I’ve created my wide table and I need to import a comma delimited file…and for the life of me, I cannot get it to import.
I’ve used the import wizard (didn’t expect that to work) and bulk insert, all to no avail.
Is there a trick to this?
if you create a wide table (i.e., a table with column set). The default in/out method will only show the column set and hidden all sparse columns. If you want to import using the sparse columns, you may need to create a customized format file. Please refer the bcp format file for details.