title | titleSuffix | description | author | ms.author | ms.date | ms.service | ms.subservice | ms.topic | helpviewer_keywords | |||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Save Showplan XML Statistics Profile events separately |
SQL Server Profiler |
Learn how to save Showplan XML Statistics Profile events captured in traces to files with SQL Server Profiler. Open the files in SQL Server Management Studio. |
MikeRayMSFT |
mikeray |
03/14/2017 |
sql |
performance |
how-to |
|
[!INCLUDE SQL Server] 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] so that you can view the graphical execution plan for each event.
-
On the File menu, select New Trace, and then connect to an instance of [!INCLUDEssNoVersion].
The Trace Properties dialog box appears.
[!NOTE]
If you select Start tracing immediately after making connection, the Trace Properties dialog box doesn't appear, and the trace begins instead. To turn off this setting, on the Tools menu, select Options, and clear the Start tracing immediately after making connection check box. -
In the Trace Properties dialog box, type a name for the trace in the Trace name box.
-
In the Use the template list, select a trace template on which to base the trace. If you don't want to use a template, select Blank.
-
Do one of the following:
-
To capture the trace to a file, select the Save to file check box. Specify a value for Set maximum file size.
Optionally, select the Enable file rollover and Server processes trace data check boxes.
-
To capture the trace to a database table, select the Save to table check box.
Optionally, select Set maximum rows, and specify a value.
-
-
Optionally, select the Enable trace stop time check box, and specify a stop date and time.
-
Select the Events Selection tab.
-
In the Events data column, expand the Performance event category, and then select the Showplan XML Statistics Profile check box. If the Performance event category isn't available, check Show all events to display it.
The Events Extraction Settings tab is added to the Trace Properties dialog box.
-
On the Events Extraction Settings tab, select Save XML Showplan events separately.
-
In the Save As dialog box, enter the file name to store the Showplan XML Statistics Profile events.
-
Select All batches in a single file to save all Showplan XML Statistics Profile events in a single XML file. Or select Each XML Showplan batch in a distinct file to create a new XML file for each Showplan XML Statistics Profile event.
-
To view the Showplan XML Statistics Profile event file in SQL Server Management Studio, on the File menu, point to Open, and select File. Browse 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.
Analyze queries with Showplan results in SQL Server Profiler