Adding a Column Set

  • Comments posted to this topic are about the item Adding a Column Set

  • Now that is interesting, thanks Steve.
    good question

    ____________________________________________
    Space, the final frontier? not any more...
    All limits henceforth are self-imposed.
    “libera tute vulgaris ex”

  • Interesting!
    Also, you don't need to drop the entire table, you can drop sparse columns and re-add them with the ALTER TABLE command

    CREATE TABLE UserConfig
    ( UserConfigKey INT IDENTITY(1,1) NOT NULL CONSTRAINT UserConfigPK PRIMARY KEY
    , UserID INT
    )

    ALTER TABLE UserConfig ADD Options XML COLUMN_SET FOR ALL_SPARSE_COLUMNS     
    , IsActive BIT SPARSE
    , IsSubscriber BIT SPARSE
    , DefaultQuantity INT SPARSE

  • didn't know so learned something new, definitely not the answer i was expecting

    Thanks for the question

    ---------------------------------------------------------------------------------------
    The more you know, the more you know that you dont know

  • Sorry, I may be missing something but I was rather confused by this question because the question just reads "how do I add a column to this table" however the answers referred to XML data specifically.

    Interesting topic though, learnt something new about SPARES data types.

  • Carlo Romagnano - Tuesday, September 18, 2018 12:53 AM

    Interesting!
    Also, you don't need to drop the entire table, you can drop sparse columns and re-add them with the ALTER TABLE command

    That's true, though in either case, saving the data becomes a chore. I didn't think of just adding the sparse columns back and the column set, but that's cool

  • n.ryan - Tuesday, September 18, 2018 8:31 AM

    Sorry, I may be missing something but I was rather confused by this question because the question just reads "how do I add a column to this table" however the answers referred to XML data specifically.

    Interesting topic though, learnt something new about SPARES data types.

    add a column set. That's a type of column, which is XML.

  • Nice question and I learned something too.  Thanks Steve.

  • Steve Jones - SSC Editor - Tuesday, September 18, 2018 11:21 AM

    n.ryan - Tuesday, September 18, 2018 8:31 AM

    Sorry, I may be missing something but I was rather confused by this question because the question just reads "how do I add a column to this table" however the answers referred to XML data specifically.

    Interesting topic though, learnt something new about SPARES data types.

    add a column set. That's a type of column, which is XML.

    Did I misread it, or has it been amended? 🙂

  • misread. There are a series on column sets that  are running across weeks.

Viewing 10 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic. Login to reply