SHOWPLAN_XML

  • Comments posted to this topic are about the item SHOWPLAN_XML

    Malleswarareddy
    I.T.Analyst
    MCITP(70-451)

  • Good back to back questions from Maleshwar 🙂

    Thanks 🙂

    First I read it from BOL before answering it and got correct :-P:-)

    _______________________________________________________________
    To get quick answer follow this link:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

  • kapil_kk (6/12/2013)


    Good back to back questions from Maleshwar 🙂

    Thanks 🙂

    +1

    ~ Lokesh Vij


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

    Link to my Blog Post --> www.SQLPathy.com[/url]

    Follow me @Twitter

  • Boy, how do I hate questions like this. No wait, the question is okay, it's the answer options.

    If the question is "how many rows", the answer options should be numbers. All of them. Otherwise, you run the risk of having multiple correct options.

    As happens here. Because of the showplan option, the statement will be compiled and not executed. That is one of the options (though technically not an answer to the question).

    The result of that compilation will then be returned in XML form. That XML is embedded in a result set that has a single column and a single row. So the correct answer is also one. Sheesh!

    Given my utter lack of mindreading skills, I flipped a coin. And I got lucky this time, so I picked the correct answer. Which is a good thing - I expect to see a lot of responses from people demanding their point, so now I have one to give away to them - last time I tried, the local supermarket didn't accept them as payment, so I don't really need them anyway.

    This (badly formulated answers making multiple options correct) has happened too often recently. (No I have no statistics, this comment is based on gut feeling). Question authors, I really appreciate all you do - but before submitting, please take a minute to review the question, and checkk to make sure there is no confusion possible. (And while you're at it, how about copy/popaste the code to a server with a case sensitive collation and a locale setting other then the one you normally use to check if it runs there as well - not an issue with today's question, but I'm in a rant anyway so I'll just spill all).

    Okay, rant is out. Malls, thanks for your question. Despite its flaws, it is an informative question and I'm sure there will be people learning from it.


    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/

  • "Given my utter lack of mindreading skills, I flipped a coin. And I got lucky this time, so I picked the correct answer. Which is a good thing - I expect to see a lot of responses from people demanding their point, so now I have one to give away to them - last time I tried, the local supermarket didn't accept them as payment, so I don't really need them anyway."

    I flipped lost -- Meh its only a point so keep it I can't do anything with it other than go oooooo I got lots of points now.:w00t:

    Hope this helps...

    Ford Fairlane
    Rock and Roll Detective

  • This was removed by the editor as SPAM

  • First I read it from BOL before answering it and got correct :-P:-)

    Usually, looking up the answer first and still getting it wrong would be a cause of concern but, in this case, it was still possible.

  • Another wrong coin flip...

    I had never seen this option before so had to read it up which is great; it is the whole point of doing these questions - to learn new stuff.... so I appreciate the question.

    But the processing of the statement had better return exactly one row containing the XML in which the execution plan is described otherwise the system isn't working.

    At the same time the statement itself is not executed.

    heads or tails...?

  • Another wrong coin flip...

    Just chose the wrong correct answer... still get my point?

  • I also did not do too well on my coin flip!!! Do I get another go.....best of three perhaps...:-P

  • Hugo Kornelis (6/13/2013)


    Boy, how do I hate questions like this. No wait, the question is okay, it's the answer options.

    If the question is "how many rows", the answer options should be numbers. All of them. Otherwise, you run the risk of having multiple correct options.

    As happens here. Because of the showplan option, the statement will be compiled and not executed. That is one of the options (though technically not an answer to the question).

    The result of that compilation will then be returned in XML form. That XML is embedded in a result set that has a single column and a single row. So the correct answer is also one. Sheesh!

    Given my utter lack of mindreading skills, I flipped a coin. And I got lucky this time, so I picked the correct answer. Which is a good thing - I expect to see a lot of responses from people demanding their point, so now I have one to give away to them - last time I tried, the local supermarket didn't accept them as payment, so I don't really need them anyway.

    This (badly formulated answers making multiple options correct) has happened too often recently. (No I have no statistics, this comment is based on gut feeling). Question authors, I really appreciate all you do - but before submitting, please take a minute to review the question, and checkk to make sure there is no confusion possible. (And while you're at it, how about copy/popaste the code to a server with a case sensitive collation and a locale setting other then the one you normally use to check if it runs there as well - not an issue with today's question, but I'm in a rant anyway so I'll just spill all).

    ...

    +1. My coin flip was wrong...

  • Can't see how any coin flip was needed. One interpretation resulted in 2 correct answers, which wasn't an option. So the other interpretation had to be correct.

  • technically it does return a row. Not a row from the tables but a row that is the link to the xml editor.

    add 3 row to staging

    (3 row(s) affected)

    add 3 rows to OLTP

    (3 row(s) affected)

    returns 1 row from select. link to the xml editor for the plan.

    (1 row(s) affected)

    and yes I got it wrong.


    Thanks,

    ToddR

  • Hugo Kornelis (6/13/2013)


    Boy, how do I hate questions like this. No wait, the question is okay, it's the answer options.

    + a bunch!

  • As happens here. Because of the showplan option, the statement will be compiled and not executed. That is one of the options (though technically not an answer to the question).

    The result of that compilation will then be returned in XML form. That XML is embedded in a result set that has a single column and a single row. So the correct answer is also one. Sheesh!

    This was the reason I decided to go for the 'It will return one row'-option. I'm a bit dissapointed I was not rewarded for giving a correct answer. Interesting subject though.

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

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