本文介紹了用于查找 UDF 上次執(zhí)行時間的 TSQL 查詢的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我知道確定存儲過程上次執(zhí)行時間的方法,但是否有類似的方法可用于確定用戶定義函數的執(zhí)行時間?
I know of ways to determine the last execution time of a stored procedure, but are there similar methods available to determine the execution time of a user defined function?
推薦答案
如果詳細信息仍在緩存中...
If details are still in the cache...
SELECT qs.last_execution_time
FROM sys.dm_exec_query_stats qs
CROSS APPLY (SELECT 1 AS X
FROM sys.dm_exec_plan_attributes(qs.plan_handle)
WHERE ( attribute = 'objectid'
AND value = OBJECT_ID('[YourDBName].[dbo].[YourFunctionName]') )
OR ( attribute = 'dbid'
AND value = DB_ID('YourDBName') )
HAVING COUNT(*) = 2) CA
這篇關于用于查找 UDF 上次執(zhí)行時間的 TSQL 查詢的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯(lián)網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯(lián)系我們刪除處理,感謝您的支持!