• udayroy15 (8/29/2012)


    Sparse columns are a property of the storage layer, rather than the logical table. Therefore a SELECT…INTO statement does not copy over the sparse column property into a new table.

    I was just looking into this.

    http://msdn.microsoft.com/en-us/library/cc280604.aspx

    "Catalog views for a table that has sparse columns are the same as for a typical table. The sys.columns catalog view contains a row for each column in the table and includes a column set if one is defined."

    "Sparse columns are a property of the storage layer, rather than the logical table. Therefore a SELECT…INTO statement does not copy over the sparse column property into a new table."

    SELECT OBJECT_NAME(object_id) AS TableName, name AS ColumnName, is_sparse

    FROM SYS.COLUMNS

    WHERE object_id IN (object_id('Table1'), object_id('Table2'))

    TableNameColumnNameis_sparse

    Table1 RowID 0

    Table1 DateTimeStamp0

    Table1 Col1 1

    Table1 Col2 1

    Table1 Col3 1

    Table1 TblColumnSet0

    Table2 RowID 0

    Table2 DateTimeStamp0

    Table2 Col1 0

    Table2 Col2 0

    Table2 Col3 0

    Table2 TblColumnSet0