Friday, March 2, 2012

How to save execution plan in XML format

Use SQL Server Management Studio to save execution plans as an XML file, and to open them for viewing.

To save an execution plan by using SQL Server Management Studio options
  1. Generate either an estimated execution plan or an actual execution plan by using Management Studio.
  2. In the Execution plan tab of the results pane, right-click the graphical execution plan, and choose Save Execution Plan As.
    As an alternative, you can also choose Save Execution Plan As on the File menu.
  3. In the Save As dialog box, make sure that the Save as type is set to Execution Plan Files (*.sqlplan).
  4. In the File name box provide a name, in the format <name>.sqlplan, and then click Save.
To open a saved XML query plan in SQL Server Management Studio.
  1. In SQL Server Management Studio, on the File menu, choose Open, and then click File.
  2. In the Open File dialog box, set Files of type to Execution Plan Files (*.sqlplan) to produce a filtered list of saved XML query plan files.
  3. Select the XML query plan file that you want to view, and click Open.
    As an alternative, in Windows Explorer, double-click a file with extension .sqlplan. The plan opens in Management Studio.
How to: Display an Actual Execution Plan.
How to: Display the Estimated Execution Plan


Link Source: http://msdn.microsoft.com/en-us/library/ms190646(v=sql.90).aspx

No comments:

Post a Comment