XML Showplan

  • When I save the xml execution plan to a file, the data is truncated to the maximum column size 8,192, which results in a invalid formatted xml file.

    How can I save the complete xml?

    Thank you,

    Ben Lopez

  • Can you post the Query that it is based on?

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • How are you displaying it and saving it?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • in SSMS, I have the results going to a text file.

    I bracket my query with the set showplan_xml on, and off

    When I hit the F5, it asks me to name the output file and everything is ok. However, when I look in the text file the xml is incomplete.

    Mind you, when I output the results to a grid and click on the xml output, it opens a new window that shows the complete xml. This result can be saved to a file, either with the .sqlplan or .xml type. I'm able to click on the .sqlplan file, and it opens nicely in SSMS.

    My ultimate goal is to create and save the xml plan for many queries into a single text file. How do you do this?

    Thanks

    Ben Lopez

  • Hmmm, not sure if you can. From what I know of xml, each plan will have to be in a separate file to be valid xml and to be readable.

    Honestly, I've always either saved the xml to a file from the grid, or done a save-as on an execution plan.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • ok..Gail, really, thanks..

    but, the restriction that all xml output should go to a single file is really not that important because even if I create many files, I could write a .bat file that combines them into a single file.

    Where I see the problem is that the user has to click on the results to open the xml tab.

    Is there a SS Managment Studio (workbench) feature that would let me save the output automatically?

    Thanks, again...

    Ben Lopez

  • Benny Lopez (6/30/2008)


    Is there a SS Managment Studio (workbench) feature that would let me save the output automatically?

    Well you can set your results output to "Save to file..", but I doubt that is sufficient for you.

    Maybe there is a way to use the profiler to do this? Hmmm...

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

Viewing 7 posts - 1 through 6 (of 6 total)

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