SELECTSPID=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, SQLStatement=St.text, ObjectName= object_name(St.objectid), Elapsedms=Er.total_elapsed_time, CPUTime=Er.cpu_time, Ioreads=Er.logical_reads+er.reads, Iowrites=er.writes, Lastwaittype=Er.last_wait_type, StartTime=Er.start_time, Protocol=Con.net_transport, Connectionwrites=con.num_writes, Connectionreads=con.num_reads, Clientaddress=con.client_net_address, authentication=Con.auth_scheme fromsys.dm_exec_requests erOUTERAPPLY sys.dm_exec_sql_text (er.sql_handle) St Left JOINsys.dm_exec_sessions ses onses.session_id=er.session_id Left JOINsys.dm_exec_connections con oncon.session_id=ses.session_idWHEREer.session_id> - ORDER byer.blocking_session_idDESC, er.session_id
SQL Server View the process being executed