problem with xp_trace_settextfilter (SQL Server 7)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • db dude

    problem with xp_trace_settextfilter (SQL Server 7)

    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_addnew queue 1000, 5, 95, 90, @column_value,
    @queue_handle OUTPUT
    exec xp_trace_seteve ntclassrequired @queue_handle, 12, 1
    exec xp_trace_settex tfilter @queue_handle, NULL, '--%'\r\n
    exec xp_trace_geteve nts @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.
Working...