• johnnyrmtl (3/20/2013)


    Since the trace will never be closed and it will be started via command line , how would I go upon this if at all possible in validating which events are being logged :unsure:

    what? what do you mean validating which events? if you create a trace, it has the events you defined; nothing more and nothing less.

    The scripts i provided allow you to spot check and see the events you specified, so you can be sure of yourself, but it will not auto-magically change, so what is there to validate?

    Do you think SQL will somehow ignore the commands in your script, and suddenly not track the events you specified?

    just a reminder, when you say "started via command line, you know better than to use Profiler 24/7, right? that's a major no no,and strongly frowned upon.

    instead you create the trace server side, and let that run forever, if needed. then you query it as needed to review the data captured.

    * I was thinking maybe by "validating which events", you really mean how do i see the traces contents.

    i usually use something like this for a SERVER SIDE (not a profiler trace):

    --SELECT * from sys.traces

    declare @TraceIDToReview int

    declare @path varchar(255)

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

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

    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

    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!