How to find the currently running queries in SQL Server

—>> current running querySELECT SPID = er.session_id ,STATUS = ses.STATUS ,[Login] = ses.login_name,Host = ses.host_name ,BlkBy = er.blocking_session_id,DBName = DB_Name(er.database_id) ,CommandType = er.command,ObjectName = OBJECT_NAME(st.objectid) ,CPUTime = er.cpu_time,StartTime = er.start_time ,TimeElapsed = CAST(GETDATE() – er.start_time AS TIME),SQLStatement = st.textFROM sys.dm_exec_requests erOUTER APPLY sys.dm_exec_sql_text(er.sql_handle) stLEFT JOIN sys.dm_exec_sessions ses ON ses.session_id = er.session_idLEFT JOIN sys.dm_exec_connections con ON …

How to find the currently running queries in SQL Server Read More »