–在SSMS里选择以文本格式显示结果
SELECT TOP 10
dest.[text] AS ‘sql语句’,[cpu_time]
FROM sys.[dm_exec_requests] AS der
CROSS APPLY
sys.[dm_exec_sql_text](der.[sql_handle]) AS dest
WHERE [session_id]>50
ORDER BY [cpu_time] DESC
–在SSMS里选择以文本格式显示结果
SELECT TOP 10
dest.[text] AS ‘sql语句’,[cpu_time]
FROM sys.[dm_exec_requests] AS der
CROSS APPLY
sys.[dm_exec_sql_text](der.[sql_handle]) AS dest
WHERE [session_id]>50
ORDER BY [cpu_time] DESC