Profiler filter question

  • I'd like to add multiple filter conditions to a single Profiler trace, but have them process as if there's an "OR" between them. As I understand, the default behavior is to process them as an "AND".

    For instance, I'd like it to list all rows where the "ApplicationName = 'ABC'" or the "NTUserName = 'DEF'" or the "HostName = 'GHI'". is this possible in a single trace? Or will I have to simply run simultaneous traces for each filter?

    Thanks...Troy

  • sp_trace_setfilter - https://msdn.microsoft.com/en-us/library/ms174404.aspx

    See Logical Operator flag.

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • Read through that a couple times Kev, it appears the logical operator applies to multiple filters within the same column. My goal is OR's between filters on different columns. As in...

    NTUserName = 'ABC' or...

    LoginName = 'DEF' or...

    HostName = 'GHI'

  • The Grateful DBA (2/17/2016)


    Read through that a couple times Kev, it appears the logical operator applies to multiple filters within the same column. My goal is OR's between filters on different columns. As in...

    NTUserName = 'ABC' or...

    LoginName = 'DEF' or...

    HostName = 'GHI'

    Missed that on the quick read-through. Sorry. No go then.

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

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

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