Merge statement

  • Comments posted to this topic are about the item Merge statement

  • Good easy question.

    Of course it may be that the query processing could order the merge conditions in order of specificity. We did that with the pattern matching conditions of Hope+, maybe Haskell inherited that too so it's not obviously out of the question - but I haven't examined the semantics of merge conditions to determine whether there is guaranteed always to be a data-independent specificity-based total order on them, and I can't assert it is possible when I haven't done that analysis. If it is possible and straighforward then doing it would make it possible for people to write much more confusing Merge statements, which doesn't sound like a good thing, but it would also make it possible to tack more specific conditions on at the end and there is a good argument that writing conditions in increasing specificity order (instead of in the reverse order, as required by the SQL Merge statement) improves code readability. So what do people think - woul dthat be a good change to SQL or a bad one?

    Tom

  • Nice question ... I learned something from it so THANK YOU

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • Nice question. Thanks to DBCC Timewarp we were able to answer the Oct 14 question over a month early. :-D:-D:-D:-D

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • SQLRNNR (9/7/2011)


    Nice question. Thanks to DBCC Timewarp we were able to answer the Oct 14 question over a month early. :-D:-D:-D:-D

    [? ? ?

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • bitbucket-25253 (9/7/2011)


    SQLRNNR (9/7/2011)


    Nice question. Thanks to DBCC Timewarp we were able to answer the Oct 14 question over a month early. :-D:-D:-D:-D

    [? ? ?

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • an easy question but informative!

  • This was removed by the editor as SPAM

  • SQLRNNR (9/7/2011)


    Nice question. Thanks to DBCC Timewarp we were able to answer the Oct 14 question over a month early. :-D:-D:-D:-D

    I'was just getting used to seeing Monday questions on the preceding Saturday, nice small 2 day warp which does no harm, but anti-slips of more than a month will take some getting used to.

    There's an even bigger time anti-slip on this article[/url] and yet bigger again on its successor[/url]; I commented on the fomer before I noticed the time discrepancy (several others had commented too) but I noticed the timeslip on its successor when I oicked its discussion up frm "recent posts" and refrained from commenting because with nearly three months to go it could be an early draft. The three preceding articles in that "stairway" also had first posts for their discussions ranging from 1 month to two months before the publication dates. SO articles, discussions, and QoTDs all getting warped backwards in time. How much antimatter is Steve wasting to generate these unintentional (??) warps?

    Of course these are still small anti-slips, nowhere near big enough to be useful to the project managers of large UK govt IT projects. :w00t:

    Tom

  • good question!!!

    why is it possible to answer this question? if it should be displayed on Oct. 14!


    [font="Times New Roman"]rfr.ferrari[/font]
    DBA - SQL Server 2008
    MCITP | MCTS

    remember is live or suffer twice!
    the period you fastest growing is the most difficult period of your life!
  • there is no prerequiste is defined for this question.

    such as procedure must be already created, UnitMeasure table to be created with production user etc.

    Because of this, this has to treated as invalid question.

    Always Think Positive

  • Nice question. I learned something new about MERGE.

    I also learned that sometimes the internet likes to play tircks with time.

  • srikanthms (9/8/2011)


    there is no prerequiste is defined for this question.

    such as procedure must be already created, UnitMeasure table to be created with production user etc.

    Because of this, this has to treated as invalid question.

    The question is about the errors in the merge statement.

    Most people know to change an Alter Procedure to a Create Procedure statement if the sproc does not exist in thier environment.

  • srikanthms (9/8/2011)


    there is no prerequiste is defined for this question.

    such as procedure must be already created, UnitMeasure table to be created with production user etc.

    Because of this, this has to treated as invalid question.

    If you simply want to run the script - everything you need to make the UnitMeasure Table is available in the script (at least the pertinent parts required for the proc). As for the "alter procedure" just change that to a create and you can create the proc.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Sometimes the questions are built on such 'mistakes' like this ALTER/CREATE PROCEDURE. Now it's a 'you should know that it's only meaningless failure'.

    How can we decide which option to use?

    Actually the question was: what will the above code output: no right choice, alter procedure fails instantly.

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

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