查看系统等待的sql
--查看系统等待的sql:
SELECT ss.host_name, req.session_id ,req.status ,req.blocking_session_id
,req.wait_type ,req.wait_time ,req.wait_resource
,req.transaction_id ,st.text
FROM sys.dm_exec_requests req
CROSS APPLY sys.dm_exec_sql_text(req.sql_handle) as ST
cross apply sys.dm_exec_sessions ss
where req.status = N'suspended' and ss.session_id=req.session_id