I am trying to run a trace on SQL Server 7 using the Query Analyzer
tool (not the profiler). The commands that I run are the following:
DECLARE @queue_handle int
DECLARE @column_value int
SET @column_value = 1|128|1024|512|8192|4
exec xp_trace_addnewqueue 1000, 5, 95, 90, @column_value,
@queue_handle OUTPUT
exec xp_trace_seteventclassrequired @queue_handle, 12, 1
exec xp_trace_settextfilter @queue_handle, NULL, '--%'\r\n
exec xp_trace_getevents @queue_handle, 1, 1, 100
Basically, the intention is to trace all queries, except those that
are commented out by "--". However the filter declared above filters
not only queries that start with "--" but also anyline that has "--"
in it.
For example, "-- select * from authors" gets filtered out (which is
good) however, the query "select * from authors --query number 1" also
gets filtered out(which is bad).
Is there any other way, to send up my trace filter so that only
queries which have "--" in front will get filtered out.
Is this a bug in SQL Server 7. This problem does not appear in SQL
Server 2000 using similar sp_trace_XXX procedures.
Thanks. Any help is appeciated.