Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

How to use Sparse Columns in SQL Server

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
919 views
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Aug 29, 2010

Detailed Article for "Sparse Columns in SQL Server" is available at :

http://sqlserver-training.com/how-to-use-sparse-columns-video-tutorial/

Follow us for more Updates at
-----------------------------------------
Website : http://sqlserver-training.com/
Twitter : http://twitter.com/dbatag/
Facebook : http://facebook.com/dbatag/
Linked In : http://in.linkedin.com/in/dbatag/
Subscribe to Email subscription for daily tutorials and updates: http://feedburner.google.com/fb/a/mailverify?uri=Sqlserver-training
================================

What is a SPARSE Column?

Sparse columns provide a highly efficient way of managing empty space in a database by enabling NULL data to consume no physical space. For example, sparse columns enable object models that typically contain numerous null values to be stored in a SQL Server 2008 database without experiencing large space costs.

What is a Column Set?

Tables that contain sparse columns can define a column set to return the data in all of the sparse columns in the table. Similarly to a computed column, it is not physically stored in the table; however, unlike computed columns, the data in it is directly editable. The column set returns an untyped XML representation of the data. Column sets are useful when you have a large number of sparse columns in a table and working with them is awkward.

How to use SQL Server Sparse Columns ?

We can define sparse columns by using either the CREATE TABLE or ALTER TABLE statement, using the SPARSE keyword for the columns that you require to be sparse columns.

Notes :

Sparse columns require more storage space for non-null values than a standard column.
Data types like geography, geometry, image, ntext, text, and timestamp cannot be used for sparse columns.
Download Script File, which is used in Video Presentation for Demo.

  • likes, 0 dislikes

Link to this comment:

Share to:
see all

All Comments (1)

Sign In or Sign Up now to post a comment!
  • Best Explanation, Thanks You!!!

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more