Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
hi all,I have a simple question: what system table should I query to find out when was the last time a stored proc has ran.Thank you very much,kowalskykowalsky
russell
Pyro-ma-ni-yak
5072 Posts
Posted - 2010-08-25 : 13:36:35
you can't. no such field. but this will tell you f it's been called since last restart
select query_planfrom sys.dm_exec_cached_plans cpcross apply sys.dm_exec_query_plan(cp.plan_handle) xpwhere convert(varchar(max), query_plan) like '% search object here %'and objtype = 'Proc'
russell,thanks a bunch - I was looking for the easy way out ... obviously, between restarts I can run that proc many, many times.X002548,I will do the same,Thanks again,kowalskykowalsky