SQL 2008 T-SQL

  • Comments posted to this topic are about the item SQL 2008 T-SQL

    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]

  • I got my points, due to a lucky 50/50 guess. But I'd still like to know, what eexactly is the difference between

    DeptId 2 data was updated,Deptid 5 row was deleted,A new Deptid of 6 was added

    and

    Deptid 1 no changes,DeptId 2 data was updated,Deptid 5 was deleted,A new Deptid of 6 was added

    ?


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/

  • And I was the unlucky one who guessed the other way and got it wrong. Answers 1 and 2 are the same, but imo answer 1 is more correct, since the question asked

    What actions were executed in/on the rows in the Depts table?

    Since no actions were executed on row 1 it should have been omitted.

  • yeah, lucked out on getting it right, since both of those answers are technically correct.

  • Wrong here too - I spent a lot of time deciding between answer 1 and 2, and as Paul mentioned above, plumped for 1 as the question asked about actions and no action was taken with row 1 so it shouldn't be mentioned.

    Of course I knew I'd be wrong. I seem to have the unenviable knack of choosing the wrong one whenever there are multiple correct answers, and every time I do, I vow to give up on these questions - and by the next day I'm back, getting the wrong right answer yet again! :-{

  • I think answer 1 is correct as well!

    David

  • I just guessed. This one was way to much to think about.

  • Yes, please explain the difference between answers 1 and 2 because it is very subtle.

  • I agree... I got this one right, but I was torn between the equivacy of answer 1 and 2.

    1 makes no mention of row 1, hence it is left alone.

    2 distinctly states that nothing will happen to row 1... which equates to answer 1.



    --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]

  • How on earth can you claim "no changes" is an action that was executed?

    I'm really getting tired of questions that play word games.

  • I missed that subtlety with 1 and 2. I've changed the answers to clean things up and will award back points.

  • I read the first answer, knew it was right and ignored the rest. I don't see how doing nothing is an action

  • Composed before I read Steve Jones post ....

    Sorry about that Steve I should have hit the refresh before hitting post.

    Scott Coleman

    How on earth can you claim "no changes" is an action that was executed?

    Cliff Jones

    Yes, please explain the difference between answers 1 and 2 because it is very subtle

    The action that was executed by the merge statement was the comparison between all the data in the table depts and all the data in table delta to determine if additional further action was required.

    The objective of the QOD as I understand it is to get people thinking and learning. And the subtle actions of the merge is that all the rows in both tables are examined.

    Scott Coleman

    I'm really getting tired of questions that play word games

    Scott Coleman - how about you submitting a QOD. It is quite a challenge.

    Edited at 11:20 AM

    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]

  • I'm not trying to be difficult here but I have to disagree with you bitbucket.

    If I write an update statement i get a response along the lines of

    23 row(s) affected

    Your correct answer implies that what we should expect is

    23 row(s) affected and 34 row(s) unaffected

    which isn't the case. If a row is untouched, as row 1 is, the fact it was untouched is implicit and needs no explanation as such. I appreciate it was an error that has now been corrected but trying to defend it by suggesting we missed a subtlty of the question rather than admitting that it was wrong is missing the objective of the QotW as much as you suggest we are.

    Paul

  • Excellent question.

    First because it demonstrates the MERGE,

    Second because it illustrates the $action, and

    Last because the format for the output makes the answer particularly clear.

    Specifically:

    INSERT6ProductionJonesNULLNULLNULL

    UPDATE2SalesErickson2SalesByham

    DELETENULLNULLNULL5ManufacturingBrewer

    Nice one!

    Jamie

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

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