How to find Total no of Traces Running on your Database Instance?

Suppose you want to find out how many traces are running on your SQL Server database instance?
If you don’t have any idea about it then you should read this article to get the answer. Here is a solution to find out no of traces running on your SQL Server Instance. You can also stop the trace files using script given in this article. Run below query to find out total number of traces running on your database server.

SELECT * FROM fn_trace_getinfo(default);

You will get below output:

You can find out the no of traces through trace ID column/count. Now suppose you have to stop them then run below script:

--Replace TraceID with your TraceID number that you want to stop.
DECLARE @TraceID int
SET @TraceID = 2
EXEC sp_trace_setstatus @TraceID, 0
EXEC sp_trace_setstatus @TraceID, 2

Replace the trace id value with one which has to be stopped.

Related Article:

I hope you like this article. You can writes us about your questions and feedbacks in below comment section. You can also follow our Facebook page and Twitter handle to get latest updates.

Manvendra Deo Singh: I am working as a Technical Architect in one of the top IT consulting firm. I have expertise on all versions of SQL Server since SQL Server 2000. I have lead multiple SQL Server projects like consolidation, upgrades, migrations, HA & DR. I love to share my knowledge. You can contact me on my social accounts for any consulting work.
Related Post
Leave a Comment