SQL Server: Script to find the status of Trace is running or not

In this post, I am sharing one TSQL script to find the status of SQL Server Trace.

The SQL Server Trace is very important to trace different SQL Server event for errors finding, object changes information and others.

Using this script you can find different information of the Trace like: Trace is running or not, Type of the trace, File path of the trace.

You can also visit this article to enable and disable SQL Server Default Trace.

I am fetching require trace column using a sys.traces.

Below is a script:

Anvesh Patel

Leave a Reply

2 Comments on "SQL Server: Script to find the status of Trace is running or not"

Notify of
Sort by:   newest | oldest | most voted
M V..

Dear Anvesh Patel,

we are facing a strange problem from SQL server to Entity framework while updating few records to database. Exception message as “System.Data.SqlClient.SqlException: Transaction (Process ID 55) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.” This is not able to reproduce from debug environment. But occasionally finding in production environment. Can you suggest any solution for this.