Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2004
    Posts
    1

    Unanswered: How to find out when storage procedure was last time executed

    I would really appretiate if someone would come with idea, how I can trace when storage procedure was last time executed. Single idea at this point is to put trigger on systemprocesses table

  2. #2
    Join Date
    Jan 2003
    Location
    Geneva, Switzerland
    Posts
    353
    I don't understand what you mean by "storage procedure"...

    In any case you can't put a trigger on a system table, so some other solution will be needed.

    Michael

  3. #3
    Join Date
    Feb 2002
    Location
    Willy is on vacation
    Posts
    1,208
    MDA tables capture information each time a store procedure is run. So if you write a job to poll into a reposiory table monSysStatement where ProcedureID != 0 and object_name(ProcedureID,dbid) with a getdate() appended at the end should do the trick.

  4. #4
    Join Date
    May 2005
    Posts
    3

    Last time a stored proc was executed

    If you can afford to change the code introduce a logging insert and subsequent update statement as proc begins and ends.

    Then you can query this table for the info !

    Avinash

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •