查询数据库进程

select T0.request_session_id as spid,OBJECT_NAME(T0.resource_associated_entity_id) as tableName,T0.request_status,T0.request_mode,
T1.text,T1.client_net_address,t0.resource_type,t1.connect_time,t1.last_read,t1.last_write from sys.dm_tran_locks t0 INNER JOIN ( select * from sys.dm_exec_connections cross apply sys.dm_exec_sql_text(most_recent_sql_handle) )AS T1 ON T1.session_id=t0.request_session_id where T0.resource_type='OBJECT' --and request_status='wait' ORDER BY T0.request_session_id

 

posted @ 2016-04-26 11:01  奇风★逍遥  阅读(1036)  评论(0编辑  收藏  举报