Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I find running Traces in SQL Server?

Is there an easy way to determine what traces have been set up by sp_trace_create on SQL Server 2000? How about for SQL Server 2005, 2008, 2012, or 2014?

like image 242
GordyII Avatar asked Mar 12 '09 01:03

GordyII


People also ask

How can I check my trace status?

DBCC TRACESTATUS returns a column for the trace flag number and a column for the status. This indicates whether the trace flag is ON (1) or OFF (0). The column heading for the trace flag number is either Global or Session, depending on whether you are checking the status for a global or a session trace flag.

How do I know if SQL Server trace is enabled?

Just get to the Server node on Object Explorer (SSMS) -> Right Click -> Reports -> Standard Reports -> “Server Dashboard”. Once you are here, you can expand the “Non-Default Configuration Options” and there are these Trace Flags that are enabled “Globally” on a given server.


1 Answers

SQL Server 2005 (onwards):

    SELECT * FROM sys.traces 

SQL Server 2000 :

    USE msdb     SELECT * FROM fn_trace_getinfo(default); 

Ref: fn_trace_getinfo

Column descriptions for sys.traces DMV can be found here: sys.traces

like image 116
Mitch Wheat Avatar answered Oct 12 '22 00:10

Mitch Wheat