SQL Profiler "not like" textdata filter not working

  • I am trying to set up a trace that will not display certain RPC's or SP's

    When I set up the TextData columns "Not Like" selection to have the following 2 filters:

    exec sp_reset_connection

    %PD.%

    This works fine but if I add one more to handle square brackets around the "PD.", it doesn't show any rows.

    It now shows:

    exec sp_reset_connection

    %PD.%

    %[PD.%

    I should get the same 10 rows I got before but I now don't get any.

    Why would that be?

    I would assume it would be looked at as:

    I want to see all the rows that do not have the TextData column equal to "exec sp_reset_connection" and does not contain "PD." or "[PD.]".

    Thanks,

    Tom

  • Actually the 3rd filter I was using was:

    %[PD].%

    So all three were:

    exec sp_reset_connection

    %PD.%

    %[PD].%

    I think it has something to do with the [].

    If I take the "[" out it works fine and won't show any of these.

    exec sp_reset_connection

    %PD.%

    %PD].%

    Why does the square brackets "[]" cause a problem?

    Thanks,

    Tom

  • "[ ]" are wildcard characters used in LIKE.

    Check BOL for the correct syntax of the operator and see how to use it properly:

    https://msdn.microsoft.com/en-us/library/ms179859.aspx

    _____________
    Code for TallyGenerator

  • That explains it.

    Thanks,

    Tom

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

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