MSSQL manual Trace deletion

Check this against your version

This article was last updated on Nov 5, 2024, before Applicare 10.0 was released (Jun 19, 2026), and has not been re-checked for Applicare 10.0. Confirm the steps in your environment or contact Support.

Step 1: Login into MSSQL Server with 'sa' or Applicare user. The user should have sysadmin permission and create and modify permission for SQL traces in "master" database.

Step 2: Select "master" database and select "New Query" and execute the below command.

Select * from sys.traces;

Step 3: Delete Trace

a. Stop the Agent from the task manager. b. Stop the trace if it is already running.

sp_trace_setstatus @traceid , @status;

If it is a Applicare trace then in the path column it will have the Applicare Agent Home path and at last it will end with SQLTraceProfiling.trc and SQLDeadlockTraceProfiling.trc

Trace details

id - @traceID

status - @status

Status Conditions

0 - Stops the specified trace. 1 - Starts the specified trace. 2 - Closes the specified trace and deletes its definition from the server.

Path - Trace file created path

Modifies the current state of the specified trace

Replace the @traceid with correct id and @status with status condition and execute the above query

Let us consider @traceid - 2

Stop and delete Trace entry from server

sp_trace_setstatus 2 , 0;
sp_trace_setstatus 2 , 2

Step 4: Delete the trace files from the Agent Home directory.

Was this article helpful?

Votes and follows are kept by Zendesk, so they need a Help Center account. These buttons open this article there.

Opens Zendesk · needs internet and sign-in

Still stuck? Contact support