Column Sets

Column sets provide an alternative way to view and work with all the sparse columns in a table. The sparse columns are aggregated into a single untyped XML column, which simplifies working with many sparse columns in a table. The XML column used for a column set is similar to a calculated column in that it is not physically stored, but unlike calculated columns, it is updateable.

There are some restrictions on column sets:

• You cannot add a column set to a table that already has sparse columns.

• You can define only one column set per table.

• Constraints or default values cannot be defined on a column set.

• Computed columns cannot contain column set columns.

• A column set cannot be changed; you must delete and re-create the column ...

Get Microsoft® SQL Server 2008 R2 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.