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?