Need name of the SQL 2000 system table which retains the TRACE attributes

  • In SQL 2000, where is the name of the system table which retains the TRACE attributes? (not trace data!!)

    In SQL 2005, I can issue:

    SELECT ID FROM sys.traces WHERE path = 'F:\SQLTraceData\my_trace.trc') ----to identify a specific trace "ID" to operate on.

    I am aware of these statments:

    SELECT * FROM :: fn_trace_getinfo(default)

    exec sp_trace_setstatus 2, 0

    exec sp_trace_setstatus 2, 2

    But I want to identify the actual TRACE "ID" based on the name of the .trc file in SQL 2000

    BT
  • In SQL 2000, I accomplished this by:

    /* SQL 2000 STOP & CLEAR Here: */

    -- Stop a TRACE:

    DECLARE @TraceId int

    SELECT * INTO #TempTrace FROM :: fn_trace_getinfo(default)

    SELECT @TraceID = (SELECT TraceID FROM #TempTrace WHERE value = 'F:\SQLTraceData\myTrace')

    IF @TraceID IS NOT NULL

    EXEC sp_trace_setstatus @TraceId, 0

    -- Clear a TRACE:

    -- DECLARE @TraceId int

    -- SET @TraceId=2

    IF @TraceID IS NOT NULL

    EXEC sp_trace_setstatus @TraceId, 2

    BT

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply