Skip to content

Latest commit

 

History

History
57 lines (37 loc) · 3.57 KB

create-a-trace-sql-server-profiler.md

File metadata and controls

57 lines (37 loc) · 3.57 KB
title titleSuffix description author ms.author ms.date ms.service ms.subservice ms.topic ms.collection
Create a Trace
SQL Server Profiler
Learn how to capture event data in SQL Server Profiler by creating a trace. Read about the various options you can specify for traces.
rwestMSFT
randolphwest
08/01/2016
sql
profiler
how-to
data-tools

Create a Trace (SQL Server Profiler)

[!INCLUDE SQL Server Azure SQL Managed Instance]

This topic describes how to use [!INCLUDEssSqlProfiler] to create a trace.

To create a trace

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

    The Trace Properties dialog box appears.

    [!NOTE]
    The Trace Properties dialog box fails to appear, and the trace begins instead, if Start tracing immediately after making connection is selected. To turn off this setting, on the *Tools *menu, click Options, and clear the Start tracing immediately after making connection check box.

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

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

  4. To save the trace results, do one of the following:

    • Click Save to file to capture the trace to a file. Specify a value for Set maximum file size. The default value is 5 megabytes (MB).

      Optionally, select Enable file rollover to automatically create new files when the maximum file size is reached. You can also optionally select Server processes trace data, which causes the service that is running the trace to process trace data instead of the client application. When the server processes trace data, no events are skipped even under stress conditions, but server performance may be affected.

    • Click Save to table to capture the trace to a database table.

      Optionally, click Set maximum rows, and specify a value.

    CAUTION!! When you do not save the trace results to a file or table, you can view the trace while [!INCLUDEssSqlProfiler] is open. However, you lose the trace results after you stop the trace and close [!INCLUDEssSqlProfiler]. To avoid losing the trace results in this way, click Save on the File menu to save the results before you close [!INCLUDEssSqlProfiler].

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

  6. To add or remove events, data columns or filters, click the Events Selection tab. For more information, see: Specify Events and Data Columns for a Trace File (SQL Server Profiler)

  7. Click Run to start the trace.

See also

Permissions Required to Run SQL Server Profiler
SQL Server Profiler Templates and Permissions
SQL Server Profiler
Correlate a Trace with Windows Performance Log Data (SQL Server Profiler)