加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MsSql教程 > 正文

sqlserver 选出占用cpu的sql语句

发布时间:2020-12-12 12:56:30 所属栏目:MsSql教程 来源:网络整理
导读:SELECT TOP 10 ? ? ?total_worker_time/execution_count AS avg_cpu_cost,plan_handle,? ? ?execution_count,? ? ?(SELECT SUBSTRING(text,statement_start_offset/2 + 1,? ? ? ? (CASE WHEN statement_end_offset = -1 ? ? ? ? ? ?THEN LEN(CONVERT(nvarcha
SELECT TOP 10 ? ? ?total_worker_time/execution_count AS avg_cpu_cost,plan_handle,? ? ?execution_count,? ? ?(SELECT SUBSTRING(text,statement_start_offset/2 + 1,? ? ? ? (CASE WHEN statement_end_offset = -1 ? ? ? ? ? ?THEN LEN(CONVERT(nvarchar(max),text)) * 2 ? ? ? ? ? ?ELSE statement_end_offset ? ? ? ? END - statement_start_offset)/2) ? ? ?FROM sys.dm_exec_sql_text(sql_handle)) AS query_text ?FROM sys.dm_exec_query_stats ?ORDER BY [avg_cpu_cost] DESC

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读