17
在Sql Server 2000上,有没有办法找出上次执行存储过程的日期和时间?上次执行存储过程
在Sql Server 2000上,有没有办法找出上次执行存储过程的日期和时间?上次执行存储过程
不无记录或跟踪,恐怕
如果存储过程仍然是在过程高速缓存中,你可以找到它通过查询sys.dm_exec_query_stats动态管理执行的最后一次。在这个例子中,我也穿越适用于sys.dm_exec_query_plan两个DMF,以限定对象ID:
declare @proc_nm sysname
-- select the procedure name here
set @proc_nm = 'usp_test'
select s.last_execution_time
from sys.dm_exec_query_stats s
cross apply sys.dm_exec_query_plan (s.plan_handle) p
where object_name(p.objectid, db_id('AdventureWorks')) = @proc_nm
我相信数据管理意见于2005年SqlServer的实现,因此并不适用于SQL Server 2000. – 2009-08-03 16:02:01