• Sergiy (5/24/2013)


    Phil Parkin (5/23/2013)


    Bhaskar.Shetty (5/23/2013)


    You cannot call insert like that, = operator works while you are updating any row or table.

    Before making blanket statements like this, I find that it is always best to double-check, lest you are left looking silly in perpetuity:

    create table #test (ID int)

    insert into #test

    (ID)

    select Id = 1

    union all

    select Id = 2

    select *

    from #test as t

    Heh,

    The only one who "left looking silly in perpetuity" is actually you, Phil.

    :w00t:

    Your example actually proves the "blanket statement" from Bhaskar.Shetty:

    it inserts 2 rows, and it uses 2 "=" operators.

    2/2 = 1 row per each operator: exactly whar Bhaskar been saying!

    😛

    What does not make that statement totally right thought...

    Bizarre that you should think that Sergiy. Especially the "..exactly what Bhaskar has been saying!" bit. Exactly? Where is that post?

    No one has been asserting that the = operator in the SELECT has any function beyond (arguably) helping readability. But saying that you "cannot call insert like that" is clearly wrong. Clear to me, at least. I can only assume that you are interpreting this differently.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.