데이터베이스/MS-SQL 😃

mssql 최근 실행된 쿼리 가져오기

재우니 2020. 10. 30. 09:51



SELECT dest.TEXT AS [Query],
deqs.execution_count [Count],
deqs.last_execution_time AS [Time]
FROM sys.dm_exec_query_stats AS deqs
CROSS APPLY sys.dm_exec_sql_text(deqs.sql_handle) AS dest
ORDER BY deqs.last_execution_time DESC