• Comments posted to this topic are about the item Merge

    Ole Kristian Velstadbråten Bangås - Virinco - Facebook - Twitter

    Concatenating Row Values in Transact-SQL[/url]

  • Nice question Kristian! Thanks 🙂

    ~ Lokesh Vij

    Guidelines for quicker answers on T-SQL question[/url]
    Guidelines for answers on Performance questions

    Link to my Blog Post -->[/url]

    Follow me @Twitter

  • Great question, thanks!

    Need an answer? No, you need a question
    My blog at
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Good question. I learn something new !!!


    Vinay Kumar
    Keep Learning - Keep Growing !!!

  • Nice question, thanks

  • Nice question on merge!

  • This was removed by the editor as SPAM

  • Thank you for the question and lesson.

  • Thanks for the question, Ole. Interesting.. (before I knew very little about the merge, but know even little bit more... 🙂 )

    ww; Raghu
    The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.

  • Good question, learned something I didn't know about Merge and I use it not every day, but at least every other week. 🙂

    --Mark Tassin
    MCITP - SQL Server DBA
    Proud member of the Anti-RBAR alliance.
    For help with Performance click this link[/url]
    For tips on how to post your problems[/url]

  • Ugh, apparently I really need to use MERGE more often.

    Thanks for the great question!

  • What's Merge got to do with Valentine's Day?? 😉 Just kidding, good question!

  • Great question... learnt something new today..! Thanks for the qotd

    If I can answer a question then anyone can answer it..trying to reverse the logic.. :hehe:

  • Nice question. However, the explanation would have been better if it had pointed out that filters like this can be placed in the when matche/not matched conditions. In this merge statement the when clause should have been when not matched by target and src.RowNo = 1 if the intention was to get only the three rows with RowNo 1.

    In fact even filtering of the target table in the on clause other than with a matching codition between source and target is stated by MS to be bad practice, as it can lead to unexpected results (ie it doesn't necessarily do what you would expect it to do).


    It is important to specify only the columns from the target table that are used for matching purposes. That is, specify columns from the target table that are compared to the corresponding column of the source table.


  • Terrific and subtle point. You got me. Any "filtering" must be done in the WHEN [NOT] MATCHED AND xxx clause.

Viewing 15 posts - 1 through 15 (of 39 total)

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