Inserting in a Column Set

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

  • Tricky treaty...
    Nice question, thanks Steve

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

  • Even without the missing ')', one gets it right! - But it takes a code correction to get it wrong in the right way, so to speak.

    Incorrect syntax near ')'.

  • morlindk - Monday, October 1, 2018 11:37 PM

    Even without the missing ')', one gets it right! - But it takes a code correction to get it wrong in the right way, so to speak.

    Incorrect syntax near ')'.

    Yup. I'm guessing Steve will blame that on the Cut'n'Paste monster again. 🙂


    Just because you're right doesn't mean everybody else is wrong.

  • And to be picky, the error really doesn't have anything to do with column sets. It simply addresses the fact that there are more items in the VALUES list than in the list of column names.
    If you actually include the name of the column set as well you get the following error:

    Msg 360, Level 16, State 1, Line 11
    The target column list of an INSERT, UPDATE, or MERGE statement cannot contain both a sparse column and the column set that contains the sparse column. Rewrite the statement to include either the sparse column or the column set, but not both.


    Just because you're right doesn't mean everybody else is wrong.

  • morlindk - Monday, October 1, 2018 11:37 PM

    Even without the missing ')', one gets it right! - But it takes a code correction to get it wrong in the right way, so to speak.

    Incorrect syntax near ')'.

    +1  That's two days on the bounce that the question is borked.

  • morlindk - Monday, October 1, 2018 11:37 PM

    Even without the missing ')', one gets it right! - But it takes a code correction to get it wrong in the right way, so to speak.

    Incorrect syntax near ')'.

    +1

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

  • morlindk - Monday, October 1, 2018 11:37 PM

    Even without the missing ')', one gets it right! - But it takes a code correction to get it wrong in the right way, so to speak.

    Incorrect syntax near ')'.

    That's what I get for reformatting in the editor. Corrected.

  • Surprisingly low number of attempts... Thanks, Steve!

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

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