Thanks for your suggestion. I tried it but it doesn't work either; it still
behaves as an AND.
"Jacco Schalkwijk" <NOSPAMjaccoseurostop.co.uk> wrote in message
news:OcJOKMuRDHA.560TK2MSFTNGP10.phx.gbl...an> I don't have time to test this, but what if you set BOTH reads and cpu to
> I think the filters work something like:
> WHERE andcondition1
> AND andcondition2
> AND andcondition3...
> AND (orcondition1 OR orcondition2 OR...)
> Which means that if you only have 1 orcondition it will work the same as?> andcondition.
> Jacco Schalkwijk MCDBA, MCSD, MCSE
> Database Administrator
> Eurostop Ltd.
> "Joris Laperre" <joris.laperrebumrungrad.com> wrote in message
> news:u4B5Y#sRDHA.2480tk2msftngp13.phx.gbl...> > Hi,
> > Did anyone get the sp_trace_setfilter to work with a logical operator ORReads> Profiler' --> > Below an extract from my stored procedure to start a trace:
> > -- Set the Filters
> > EXECUTE master..sp_trace_setfilter TraceID, 10, 0, 7, N'SQL> Database> > ApplicationName
> > EXECUTE master..sp_trace_setfilter TraceID, 3, 0, 0, dbid --> > EXECUTE master..sp_trace_setfilter TraceID, 16, 0, 4, reads --repeating> > EXECUTE master..sp_trace_setfilter TraceID, 18, 1, 4, cpu -- CPU
> > I want to see events for a given database that aren't generated by the
> > profiler and where either the reads OR the cpu exceed a threshold. BOL
> > doesn't say anything about operator precedence, so I also triedother> over> > the application name and database filters in case AND takes precedence> > OR. But in either case, it ANDs all filters regardless of the logical
> > operator (third parameter: 0 = AND, 1 = OR), so I get every event with a
> > minimum number of reads AND a minimum number of cpu usage.
> > Note that SQL Profiler doesn't give you the option of OR-ing filters.
> > Has anyone managed to OR filters for a trace ? Any sample code ? Any>> > information that may be useful ?
> > Thanks in advance.
> > Kind regards,
> > Joris Laperre