SQL Server View the process being executed

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.