SQL Server Profiler: Help needed monitoring one specific store procedure

  • In the TextData column add a filter that reads like this:

    Like '%yourSprocName%'

    I recall trying this once and not being able to get it to work. Test it out first.

    __________________________________________________________________________________
    SQL Server 2016 Columnstore Index Enhancements - System Views for Disk-Based Tables[/url]
    Persisting SQL Server Index-Usage Statistics with MERGE[/url]
    Turbocharge Your Database Maintenance With Service Broker: Part 2[/url]

  • A key point here is to make sure the events you are tracking include the TextData column. One way to get this working is to start a trace filtering on SPID and from that SPID (an already connected SSMS query window) execute your SP. Then save the trace to a file, re-open it and apply a filter on TextData until you get it right.

  • Thanks guys.

    I will have a play around with that today.

    TT

  • hai all..

    i want to know, how to make sql profiler running daily?

    thanks

  • sweetpea_3007 (1/7/2009)


    hai all..

    i want to know, how to make sql profiler running daily?

    thanks

    You just need to script out your profiler session with all your chosen events, columns, filters and other settings and create a job to run that script daily, say as a stored procedure. It is best to run Profiler through script, especially if it needs to be run on a regular basis.

    __________________________________________________________________________________
    SQL Server 2016 Columnstore Index Enhancements - System Views for Disk-Based Tables[/url]
    Persisting SQL Server Index-Usage Statistics with MERGE[/url]
    Turbocharge Your Database Maintenance With Service Broker: Part 2[/url]

  • If you still need Profiler (SQL 2000), to filter on specific stored procedures, enter as a filter on TextData, for example:

    exec _getStuff%

    No single quotes or anything else and it will work.

  • Or filter by ObjectID:

    use db_name;

    select object_id('sprocName');

    __________________________________________________________________________________
    SQL Server 2016 Columnstore Index Enhancements - System Views for Disk-Based Tables[/url]
    Persisting SQL Server Index-Usage Statistics with MERGE[/url]
    Turbocharge Your Database Maintenance With Service Broker: Part 2[/url]

  • Is there a way to monitor more than one SPROC? In other words, can i monitor more objects..i have 9 SPROCS to be monitored..

  • Yes, in the filter you can more than one item. Matches are made using LIKE so multiple sprocs can be used.

  • t berry (2/26/2009)


    Yes, in the filter you can more than one item. Matches are made using LIKE so multiple sprocs can be used.

    Interesting, I haven't tried that.

    What would be the syntax?

    __________________________________________________________________________________
    SQL Server 2016 Columnstore Index Enhancements - System Views for Disk-Based Tables[/url]
    Persisting SQL Server Index-Usage Statistics with MERGE[/url]
    Turbocharge Your Database Maintenance With Service Broker: Part 2[/url]

  • For syntax see my post for this topic on 18 Feb, 2009.

  • t berry (2/18/2009)


    If you still need Profiler (SQL 2000), to filter on specific stored procedures, enter as a filter on TextData, for example:

    exec _getStuff%

    No single quotes or anything else and it will work.

    How would it work for multiple stored procedures, that do not start with the same set of characters?

    __________________________________________________________________________________
    SQL Server 2016 Columnstore Index Enhancements - System Views for Disk-Based Tables[/url]
    Persisting SQL Server Index-Usage Statistics with MERGE[/url]
    Turbocharge Your Database Maintenance With Service Broker: Part 2[/url]

  • i would like to monitor a single store procedure and all the actions inside that store procedure!

    setting TextData like '%MySP%' does not help 🙁

Viewing 13 posts - 1 through 14 (of 14 total)

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