Search

Thursday, July 28, 2011

Info about trace files

To get info about ongoing traces you can run
:
SELECT * FROM :: fn_trace_getinfo(default)


To decide trace status you can use:

EXEC sp_trace_setstatus 1,2

The first number sets the trace id and the second number decides what happens as follows;

0 = stoppar tracen
1 = startar tracen
2 = Closes the specified trace and deletes its definition from the server.

Notice that you first has to stop the trace before you can delete it e.x;

EXEC sp_trace_setstatus 1,0
go
EXEC sp_trace_setstatus 1,2

No comments:

Post a Comment