Re: Problem using SP_TRACE_SETFILTER - it doesn't seem to apply th
From: Wanderer (Wanderer_at_discussions.microsoft.com)
Date: 01/03/05
- Next message: Nigel Rivett: "Re: SQL Server 2GB Memory Limit"
- Previous message: Mike Epprecht (SQL MVP): "RE: SQL Server 2GB Memory Limit"
- In reply to: David Gugick: "Re: Problem using SP_TRACE_SETFILTER - it doesn't seem to apply th"
- Next in thread: Wanderer: "Re: Problem using SP_TRACE_SETFILTER - it doesn't seem to apply th"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 3 Jan 2005 01:45:02 -0800
Well, I've tried to add steps to check on the adding of the filters, and all
i can say is - it doesn't seem to work!
Here is a section of the code (hopefully the wordwrap doesn't make it
completely illegible).
****code****
exec sp_trace_setfilter
@TraceId,@ColumnId,@LogicalOperator,@ComparisonOperator,@DurationFilterValue
select @ReturnCode=@@Error
Print 'Trace Filter 2 set'
if @ReturnCode <> 0
Begin
if @ReturnCode = 1
print 'ERROR 1 - Unknown error.'
else
if @ReturnCode = 2
Print 'ERROR 2 - The trace is currently running. Changing the trace at
this time will result in an error.'
else
if @ReturnCode = 4
Print 'ERROR 4 - The specified Column is not valid.'
else
if @ReturnCode = 5
print 'ERROR 5 - The specified Column is not allowed for filtering.'
else
if @ReturnCode = 6
print 'ERROR 6 - The specified Comparison Operator is not valid. '
else
if @ReturnCode = 7
print 'ERROR 7 - The specified Logical Operator is not valid.'
else
if @ReturnCode = 9
print 'ERROR 9 - The specified Trace Handle is not valid.'
else
if @ReturnCode = 13
print 'ERROR 13 - Out of memory. Returned when there is not enough memory
to perform the specified action.'
else
if @ReturnCode = 16
print 'ERROR 16 - The function is not valid for this trace.'
else
Print 'ERROR x - Unknown Error'
GoTo ErrorHandler
end
SELECT * FROM ::fn_trace_getfilterinfo(@TraceID)
****code****
I get NO response that an error has occurred, the "print's" confirm that the
code stepped through, yet the ::fn_trace_setfilter returns NO ROWS!
"David Gugick" wrote:
> Wanderer wrote:
> > Ok - so it seems that, for some reason, the sp_trace_setfilter is not
> > working. Going to try and build in some logic to catch and check why.
> > Anything that you can see from my SP, that points the way, I'd
> > appreciate hearing it.
> >
>
> You wouldn't see the filter in Profiler if you opened a TRC file after a
> server-side trace. All you see in Profiler is the events captured during
> the trace. The other information (filters) are not saved anywhere in the
> trace file.
>
> Also, I assume when you ran the following statement, you knew that the
> running trace had a handle of 1? It seems unlikely that the handle would
> be 1 unless you just cycled the server.
> SELECT * FROM ::fn_trace_getfilterinfo(1)
>
> I can't read your script file because of the wrapping. What events did
> you capture that are not showing the filter applied?
>
> --
> David Gugick
> Imceda Software
> www.imceda.com
>
>
- Next message: Nigel Rivett: "Re: SQL Server 2GB Memory Limit"
- Previous message: Mike Epprecht (SQL MVP): "RE: SQL Server 2GB Memory Limit"
- In reply to: David Gugick: "Re: Problem using SP_TRACE_SETFILTER - it doesn't seem to apply th"
- Next in thread: Wanderer: "Re: Problem using SP_TRACE_SETFILTER - it doesn't seem to apply th"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|