Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to find the Last time proc executed?

Status
Not open for further replies.

sparkme

Programmer
Oct 3, 2003
30
US
Is there any way we can find the last time a stored procedure was executed?

Thnaks in advance
 
Depending on how often you flush the cache (or your system does) you could do a select from master.dbo.syscacheobjects and it should tell you when the last time a specific object was executed (been a while but i believe it is there)

If it isn't in the cache - there is no way I am aware of (othter than running a trace or placing raiserror statment into each proc that would log it's execution)

HTH

Rob
 
To add to Rob's post, you can also insert a row into a table from your SPs and create your own trace table. Keep in mind it may get big depending on how often and how many users are on your system.
 
Thanks again for all the replies.

There is no entry in master.dbo.syscacheobjects table to find last time the proc was executed . The only thing we can do is to create a Log table and insert every time the proc is executed .

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top