• i create a a view for every trace i create; it's just much easier to access.

    from there, i can group the data however i need to, since it's just an object.

    --SELECT * from sys.traces

    declare @TraceIDToReview int

    declare @path varchar(255)

    declare @cmd varchar(max)

    SET @TraceIDToReview = 1 --this is the trace you want to review!

    SELECT @path = path from sys.traces WHERE id = @TraceIDToReview

    SET @cmd = '

    CREATE VIEW MyCustomTrace' + CONVERT(VARCHAR,@TraceIDToReview) + ' AS

    SELECT

    TE.name As EventClassDescrip,

    v.subclass_name As EventSubClassDescrip,

    T.*

    FROM ::fn_trace_gettable(' + @path + ', default) T

    LEFT OUTER JOIN sys.trace_events TE ON T.EventClass = TE.trace_event_id

    LEFT OUTER JOIN sys.trace_subclass_values V

    ON T.EventClass = V.trace_event_id AND T.EventSubClass = V.subclass_value'

    PRINT(@cmd)

    EXEC(@cmd)

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!