日期:2014-05-17 浏览次数:20504 次
CREATE PROC up_wyltest
AS
SELECT * FROM master..spt_values
GO
--#1.一般的话,静态分析就行。
SET STATISTICS IO, TIME ON
EXEC up_wyltest
GO
--#2.定时监控系统目录
SELECT a.name,b.execution_count, b.last_elapsed_time --微秒
FROM sys.procedures A
LEFT JOIN sys.dm_exec_procedure_stats B
ON a.object_id = b.object_id
WHERE a.name = 'up_wyltest'
GO