网上找的一段句子,执行时在下面蓝色部分"."附近有语法错误?CROSS APPLY不会用,帮忙看下吧。SELECT TOP 10
dest.[text] AS 'sql语句'
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
版本2008R2
------解决方案--------------------
--必须切换到master
use master
go
SELECT TOP 10
dest.[text] AS 'sql语句'
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
------解决方案--------------------
外围应用配置器里面的CLR必须开启
------解决方案--------------------
你是不是没在master下执行啊?