SQL PROFILER DURATION FILTER NOT WORKING

  • Hi All,

    I am trying to set up profiler trace to capture statements and sp's taking more than 3 secs and I have used the below filter

    -- Set the Filters

    declare @intfilter int

    declare @bigintfilter bigint

    exec sp_trace_setfilter @TraceID, 10, 0, 7, N'SQL Server Profiler - 4fcaf8f3-fb7b-464b-9043-3dc766736fc2'

    exec sp_trace_setfilter @TraceID, 10, 0, 1, NULL

    set @bigintfilter = 3000000

    exec sp_trace_setfilter @TraceID, 13, 0, 4, @bigintfilter

    However, I still see that profiler is capturing all the events even if they are taking 0 secs to execute which is increasing my result set.

    Can someone please suggest if any modification is needed for my duration filter so that I can only get queries taking more than 3 seconds?

    Thanks!!

  • We need to see the columns in your trace.

    The sp_trace_setfilter applies filters to numbered columns. That's the 10 and 13 part.

    Did you create the trace with profiler and then script it out or did you create it as a text file first?

  • Do you pass the right @TraceID taken from sys.traces?

    Also, try to call it with hard-coded value:

    exec sp_trace_setfilter 2, 13, 0, 4, 3000000

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply