Skip to content
JaKson Note Logo JaKson Note Logo JaKson Note Logo
  • HD Tune

查詢 MS SQL Server 的SQL指令log(2016以上)

查詢 MS SQL Server 的SQL指令log(2016以上)

語法

SELECT st.text as sql_statement,
qs.creation_time as plan_last_compiled,
qs.last_execution_time as plan_last_executed,
qs.execution_count as plan_executed_count,
qp.query_plan
FROM sys.dm_exec_query_stats qs
CROSS APPLY sys.dm_exec_sql_text(qs.plan_handle) st
CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) qp
order by total_elapsed_time/execution_count desc
jakson2023-06-01T13:58:24+08:001 6 月, 2023|

分享至您的平台

FacebookTwitterRedditLinkedInWhatsAppTumblrPinterestVkEmail:

相關文章:

  • server 2019 安裝 termainl service 後注意事項及問題

    10 8 月, 2023 | 0 條評論
  • 開放 PowerShell ISE 測試權限

    1 6 月, 2023 | 0 條評論
  • 使用 PoweShell 連接 MSSQL

    1 6 月, 2023 | 0 條評論

© Copyright 2021 Powered by JaKson

Go to Top