SQL SERVER查询当前正在执行的存储过程

select object_name(st.objectid) as [存储过程名称],

         st.encrypted as [存储过程是否加密],

         st.text as [存储过程内容,如果加密就看不到],

         qs.last_read as [存储过程开始执行时间]

from sys.dm_exec_connections as qs

cross apply sys.dm_exec_sql_text(qs.most_recent_sql_handle) as st

where object_name(st.objectid) is not null;

posted @ 2025-12-17 14:41  云中帆2020  阅读(0)  评论(0)    收藏  举报