Monitoring Store Procedures

  • Is there anyway to know if a certain SP is running at a certain time?

    I am sure it should be possible using the Profiler, but I need to know it using a script or view or something I can check a lot of times.

  • I can think of two options ...

    What you can do is implement a Server side trace; that filters on the text data and only tracks following events:

    SP:Starting

    SP:Completed

    Another option is (might run into some process red-tape):

    Implement a quick audit statement in proc; so every time it is called it writes to your audit table.

    Thanks.

    [font="Arial"]---

    Mohit K. Gupta, MCITP: Database Administrator (2005), My Blog, Twitter: @SQLCAN[/url].
    Microsoft FTE - SQL Server PFE

    * Some time its the search that counts, not the finding...
    * I didn't think so, but if I was wrong, I was wrong. I'd rather do something, and make a mistake than be frightened and be doing nothing. :smooooth:[/font]

    How to ask for help .. Read Best Practices here[/url].

  • If you're trying to check to see if a particular procedure is running at, say, noon, you can could query the sys.dm_exec_requests DMV to see if it's there.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

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

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