• sammesel (2/23/2011)


    Great article, looking forward for next step.

    I had a little problem when running the query - but it was easy to spot where the problem was.

    SELECT

    t.id AS TraceId ,

    path AS TraceFilePath ,

    tcat.name AS EventCategory ,

    tevent.name AS EventClassName ,

    tcolumn.name AS ColumnName

    FROM sys.traces AS t

    CROSS APPLY fn_trace_geteventinfo(t.id) AS tdef

    JOIN sys.trace_events AS tevent ON tdef.eventid = tevent.trace_event_id

    JOIN sys.trace_categories AS tcat ON tcat.category_id = tevent.category_id

    JOIN sys.trace_columns AS tcolumn ON tcolumn.trace_column_id = tdef.columnid

    WHERE t.is_default = 1 --default trace

    AND t.status= 1 --running

    ORDER BY TraceFilePath ,

    EventCategory ,

    EventClassName ,

    ColumnName ;

    thanks

    Even using this modified code my server will still not parse?

    Msg 102, Level 15, State 1, Line 8

    Incorrect syntax near '.'.

    Seems to be failing at the parameter (t.id) ?

    Microsoft SQL Server 2005 - 9.00.3080.00 (X64) Sep 6 2009 09:15:46 Copyright (c) 1988-2005 Microsoft Corporation Enterprise Edition (64-bit) on Windows NT 5.2 (Build 3790: Service Pack 2)