SHOWPLAN_XML

  • Hugo Kornelis (6/13/2013)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.

    Yep, I buttered the wrong side of my coin... ho hum!

    _____________________________________________________________________
    [font="Comic Sans MS"]"The difficult tasks we do immediately, the impossible takes a little longer"[/font]

  • Coming in late on this topic, and I think most of the debate is done and dusted, but it was fairly apparent to me that the question asked "How many rows will be reurn (sic) by the select statement"

    If I put 3 select statements and an insert statement and a drop table statement and pretty much any other T-SQL statements between the "GO" statement after the SHOWPLAN_XML ON statement and the "GO" statement immediately before the SHOWPLAN_XML OFF statement, I'll get 1 row returned. It would be the result of the SHOWPLAN_XML statement, not any of the T-SQL statements, SELECT or otherwise. The column heading "Microsoft SQL Server 2005 XML Showplan" is a bit of a giveaway there.

    Odd, it says '2005' but I am using a 2008 R2 installation. Does this live on in 2012?

    If you haven't seen or used SHOWPLAN_XML before, it's worth noting that in the SSMS results window, the returned row shows as a 'link' (that is, it's blue, and underlined, and different to the return of a normal select statement) and clicking that link will open the visual representation of the execution plan. For documenting your query designs, you can also select the returned row, and paste into an XML editor (or even a text document) for future reference, for query tuning, for baselining and/or for troubleshooting (maybe when posting issues on SSC forums so others can spot where your query is not behaving the way you think it should.)

  • Ambiguity thou art a bitch!!

    Luckily got it right but it was always going to be a gamble due to the available answers!


    MCITP
    MCTS - E-Business Card
    Twitter: WWDMark

    Try not! Do or do not, there is no try

    email: info@weekendwebdesign.co.uk
    Personal Website: http://markallen.co.uk/
    Business Website: https://www.weekendwebdesign.co.uk

  • Lucky Lucky 🙂

  • I too answered 1 row for the xml node returned

    sadly

Viewing 5 posts - 31 through 34 (of 34 total)

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