Sql server automatically creates the default trace into multiple files. These can be seen in the LOGS directory of sql server installation path.

The sys.fn_trace_getinfo has a trace_id parameter which I'm not sure where I can find.

How to view the trace_id of the default trace files?

1 Answer 1


You can find the Trace ID in the DMV sys.traces.

According to the documentation, other valid inputs are NULL, 0 or DEFAULT.

Valid inputs are the ID number of a trace, NULL, 0, or DEFAULT. NULL, 0, and DEFAULT are equivalent values in this context. Specify NULL, 0, or DEFAULT to return information for all traces in the instance of SQL Server.

But the documentation also has a warning that sys.fn_trace_getinfo should no longer be used, and to use Extended events instead.

  • What is the extended events equivalent for this?
    – variable
    Commented Sep 30, 2022 at 8:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.