此查询为我提供了在 SQL Server 上执行的命令的历史记录:
Select *
From
(
SELECT deqs.last_execution_time AS [Time],
dest.TEXT AS [Query]
FROM sys.dm_exec_query_stats AS deqs
CROSS APPLY sys.dm_exec_sql_text(deqs.sql_handle) AS dest
) x
当我添加时,Where x.Query LIKE '%Insert%'
我得到了不好的结果(我认为这是因为交叉连接):
Select *
From
(
SELECT deqs.last_execution_time AS [Time],
dest.TEXT AS [Query]
FROM sys.dm_exec_query_stats AS deqs
CROSS APPLY sys.dm_exec_sql_text(deqs.sql_handle) AS dest
) x
Where x.Query LIKE '%Insert%'
如何让交叉联接在 SQL Server 2008 R2 上正常工作?