Skip to content

Latest commit

 

History

History
67 lines (45 loc) · 3.7 KB

File metadata and controls

67 lines (45 loc) · 3.7 KB
title Save Showplan XML Statistics Profile Events Separately (SQL Server Profiler) | Microsoft Docs
ms.custom
ms.date 03/14/2017
ms.prod sql-server-2016
ms.reviewer
ms.suite
ms.technology
database-engine
ms.tgt_pltfrm
ms.topic article
helpviewer_keywords
Showplan XML events
saving Showplan XML events
events [SQL Server], Showplan XML
ms.assetid df393f13-d538-4d94-8155-9c2fdf5f755d
caps.latest.revision 20
author JennieHubbard
ms.author jhubbard
manager jhubbard

Save Showplan XML Statistics Profile Events Separately (SQL Server Profiler)

This topic describes how to save Showplan XML Statistics Profile events that are captured in traces into separate .SQLPlan files by using [!INCLUDEssSqlProfiler]. You can open the Showplan XML Statistics Profile event files in [!INCLUDEssManStudioFull], which enables you to view the graphical execution plan for each event.

To save Showplan XML statistics events separately

  1. On the File menu, click New Trace, and then connect to an instance of [!INCLUDEssNoVersion].

    The Trace Properties dialog box appears.

    [!NOTE]
    If Start tracing immediately after making connectionis selected, the Trace Propertiesdialog box does not appear and the trace begins instead. To turn off this setting, on the Toolsmenu, click Options, and clear the Start tracing immediately after making connection check box.

  2. In the Trace Properties dialog box, type a name for the trace in the Trace name box.

  3. In the Use the template list, select a trace template to base the trace on, or select Blank if you do not want to use a template.

  4. Do one of the following:

    • ClickSave to fileto capture the trace to a file. Specify a value for Set maximum file size.

      Optionally select Enable file rollover and Server processes trace data.

    • ClickSave to table to capture the trace to a database table.

      Optionally click Set maximum rows, and specify a value.

  5. Optionally select the Enable trace stop time check box, and specify a stop date and time.

  6. Click the Events Selectiontab.

  7. In the Eventsdata column, expand the Performanceevent category, and then select the Showplan XML Statistics Profilecheck box. If the Performance event category is not available, check Show all events to display it.

    The Events Extraction Settingstab is added to the Trace Propertiesdialog.

  8. On the Events Extraction Settingstab, click Save XML Showplan events separately.

  9. In the Save As dialog box, enter the file name to store the Showplan XML Statistics Profile events.

  10. Click All batches in a single file to save all Showplan XML Statistics Profile events in a single XML file, or click Each XML Showplan batch in a distinct fileto create a new XML file for each Showplan XML Statistics Profile event.

  11. To view the Showplan XML Statistics Profile event file in SQL Server Management Studio, on the File menu, point to Open, and click File. Navigate to the directory where you saved the Showplan XML Statistics Profile event file or files to select one and open it. Showplan XML Statistics Profile event files have a .SQLPlan file extension.

See Also

Analyze Queries with SHOWPLAN Results in SQL Server Profiler