select er.session_id
, CAST(csql.text AS varchar(255)) AS CallingSQL
from master.sys.dm_exec_requests er 
WITH (NOLOCK)
       CROSS APPLY MASTER.sys.fn_get_sql (er.sql_handle) csql
where er.session_id =51

session_id即为 Spid

相关文章:

  • 2021-06-05
  • 2022-01-02
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-28
  • 2021-10-25
相关资源
相似解决方案