SELECT
equery.last_execution_time AS [Time],
esql.TEXT AS [Query]
FROM
sys.dm_exec_query_stats AS equery
CROSS APPLY sys.dm_exec_sql_text(equery.sql_handle) AS esql
WHERE esql.dbid = DB_ID('DatabasName')
ORDER BY
equery.last_execution_time DESC
equery.last_execution_time AS [Time],
esql.TEXT AS [Query]
FROM
sys.dm_exec_query_stats AS equery
CROSS APPLY sys.dm_exec_sql_text(equery.sql_handle) AS esql
WHERE esql.dbid = DB_ID('DatabasName')
ORDER BY
equery.last_execution_time DESC
No comments:
Post a Comment