Adding Multiple Columns

  • Comments posted to this topic are about the item Adding Multiple Columns

  • Nice question, Steve!

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Thanks, ran into someone that didn't know you could do this in one statement.

  • But you should add the NULLability setting to the column.  The default is somewhat obscure so you should always specify NULL or NOT NULL when adding a column.

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.

  • Steve Jones - SSC Editor wrote:

    Thanks, ran into someone that didn't know you could do this in one statement.

    That's the main reason I really liked the question.  I've run into a whole lot of folks by way of code reviews that don't know this.

    There's another nuance about adding columns.  I'll see if I'm remembering it correctly and, maybe, submit a question on it.

    And, thanks for what you do, Steve.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 5 posts - 1 through 4 (of 4 total)

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