SQL Profiler - Am I going mad!!?

  • Hi all

    I have set up a profile to capture information about a particular stored proc. I have selected the the ebents RPC:Completed, SP:Completed, SQL:StmtCompleted and SQL:BatchCompleted.

    I then set a filter on ObjectName to be the name of my stored proc.

    When I run profiler however I get lots of information through and not just the filtered info. Why is this?

    Thanks

  • Did you check the "Exclude rows that do not contain values" box?

    -- Gianluca Sartori

  • Because profiler works the opposite way to SQL Server. In SQL Server a null value never matches a filter (unless it's IS NULL), in profiler a lack of a value always matches every filter.

    It's so you can filter on something like object name and still see selected events that don't populate the object name column (like SQL:Batch completed and SQL: statement completed)

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Yes thats what is happening, thanks. I tried filtering NOT LIKE NULL, but that doesn't work unfortunately would be a nice little feature if it did I think.

  • It does exist, there's a checkbox 'exclude rows that do not contain values' (as Gianluca mentioned)

    If you check that, you may as well remove the batch completed and statement completed events, they will never have an object name on them.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Ah ok thanks

Viewing 6 posts - 1 through 6 (of 6 total)

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