Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

View a Saved Trace (Transact-SQL)

Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).

This topic describes how to use built-in functions to view a saved trace.

To view a specific trace

  • Execute fn_trace_getinfo by specifying the ID of the trace about which information is needed. This function returns a table that lists the trace, trace property, and information about the property.

    Invoke the function this way:

    SELECT *
    FROM ::fn_trace_getinfo(trace_id)
    

To view all existing traces

  • Execute fn_trace_getinfo by specifying 0 or default. This function returns a table that lists all the traces, their properties, and information about these properties.

    Invoke the function as follows:

    SELECT *
    FROM ::fn_trace_getinfo(default)
    

To run the built-in function fn_trace_getinfo, the user needs the following permission:

ALTER TRACE on the server.

Community Additions

ADD
Show:
© 2015 Microsoft