cnblogs/dcrenl/手动拼写出来的sp_who结果集.html
2024-09-24 12:43:01 +08:00

32 lines
1.4 KiB
HTML

<div id="sina_keyword_ad_area2" class="articalContent ">
<div>SELECT</DIV>
<div>SPID = er.session_id&nbsp;<wbr></DIV>
<div>,STATUS = ses.STATUS&nbsp;<wbr></DIV>
<div>,[Login] = ses.login_name&nbsp;<wbr></DIV>
<div>,Host = ses.host_name&nbsp;<wbr></DIV>
<div>,BlkBy = er.blocking_session_id&nbsp;<wbr></DIV>
<div>,DBName = DB_Name(er.database_id)&nbsp;<wbr></DIV>
<div>,CommandType = er.command&nbsp;<wbr></DIV>
<div>,SQLStatement = st.text&nbsp;<wbr></DIV>
<div>,ObjectName = OBJECT_NAME(st.objectid)&nbsp;<wbr></DIV>
<div>,ElapsedMS = er.total_elapsed_time&nbsp;<wbr></DIV>
<div>,CPUTime = er.cpu_time&nbsp;<wbr></DIV>
<div>,IOReads = er.logical_reads + er.reads&nbsp;<wbr></DIV>
<div>,IOWrites = er.writes&nbsp;<wbr></DIV>
<div>,LastWaitType = er.last_wait_type&nbsp;<wbr></DIV>
<div>,StartTime = er.start_time&nbsp;<wbr></DIV>
<div>,Protocol = con.net_transport&nbsp;<wbr></DIV>
<div>,ConnectionWrites = con.num_writes&nbsp;<wbr></DIV>
<div>,ConnectionReads = con.num_reads&nbsp;<wbr></DIV>
<div>,ClientAddress =
con.client_net_address&nbsp;<wbr></DIV>
<div>,Authentication = con.auth_scheme&nbsp;<wbr></DIV>
<div>FROM sys.dm_exec_requests er&nbsp;<wbr></DIV>
<div>OUTER APPLY sys.dm_exec_sql_text(er.sql_handle)
st&nbsp;<wbr></DIV>
<div>LEFT JOIN sys.dm_exec_sessions ses ON ses.session_id =
er.session_id&nbsp;<wbr></DIV>
<div>LEFT JOIN sys.dm_exec_connections con ON con.session_id =
ses.session_id&nbsp;<wbr></DIV>
</div>