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:

Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.

If you like this post, then please share it with others.
Please follow dbrnd.com, I will share my experience towards the success of Database Research and Development Activity.

I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.

More from dbrnd.com

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..
M V..
6 months 27 days ago

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.