• na1774 (7/30/2012)


    OMG. You are Amazing. Thank you very much. You were a ton of help.

    I was wondering when we run this does it query the current trace file. What I mean is, suppose there a number of trace files for the default trace and I run this query does it search only the current trace file that is being written to?

    that's the sweet part; the DEFAULT parameter makes it read ALL the files (five in the case of the default trace.

    from http://msdn.microsoft.com/en-us/library/ms188425.aspx

    If number_files is specified as default, fn_trace_gettable reads all rollover files until it reaches the end of the trace. fn_trace_gettable returns a table with all the columns valid for the specified trace. For more information, see sp_trace_setevent (Transact-SQL).

    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!