• johnnyrmtl (3/20/2013)


    Just to clarify ... if I am starting a custom trace ( not server default ) from profiler and would like to confirm the events that I am tracing .

    Would these monitored events be in a sys table somewhere for me to query without having to go in the trace file ?

    technically it's a sys table valued function, but yes it's accessible;

    taking a piece of the script i posted for scripting any trace, once you KNOW the trace you want to review, it's like this to see exactly which events, plus which columns:

    --SELECT * from sys.traces

    declare @TraceIDToReview int

    declare @path varchar(255)

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

    SELECT ISNULL(E.Name, '') As EventName

    FROM ::fn_trace_geteventinfo(@TraceIDToReview) AS X

    INNER JOIN sys.trace_events E

    ON X.eventid = E.trace_event_id

    GROUP BY E.Name

    SELECT

    ISNULL(E.Name, '') As EventName,

    ISNULL(V.name, '') As ColumnName

    FROM ::fn_trace_geteventinfo(@TraceIDToReview) AS X

    INNER JOIN sys.trace_events E

    ON X.eventid = E.trace_event_id

    INNER JOIN sys.trace_columns V

    ON X.columnid = V.trace_column_id

    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!