SYSK 338: What SQL Queries Are Currently Running?


That’s easy — just run the SQL statement below…


 


select session_id, request_id, start_time, status, cpu_time, er.total_elapsed_time,


      substring(st.text,


      (er.statement_start_offset/2) + 1,


      ((case er.statement_end_offset when 1 then datalength(st.text) else er.statement_end_offset end


      er.statement_start_offset)/2) + 1) as query  


from sys.dm_exec_requests er


cross apply sys.dm_exec_sql_text(er.sql_handle) st


 


 

Comments (1)

  1. christi parks says:

    Hello all,I am new and I would like to ask that what are the benefits of sql training, what all topics should be covered and it is kinda bothering me … and has anyone studies from this course wiziq.com/course/125-comprehensive-introduction-to-sql of SQL tutorial online?? or tell me any other guidance…

    would really appreciate help… and Also i would like to thank for all the information you are providing on sql.