1 Select --* 2request_session_id asspid,3Resource_type asResType,4resource_database_id asdbid,5 db_name(resource_database_id) asdbname,6Resource_description asRes,7resource_associated_entity_id asResid,8 Case whenResource_type= 'OBJECT' Then object_name(resource_associated_entity_id)9 End Ten asObjectName, OneRequest_mode asmode, ARequest_status asStatus - fromsys.dm_tran_locks - the - Select --* -session_id asspid, - Connect_time, + Last_read, - Last_write, + Most_recent_sql_handle, A text at fromsys.dm_exec_connections - CrossApply Sys.dm_exec_sql_text (Most_recent_sql_handle)--As a - wheresession_idinch( About, $) - - Select --* -session_id asspid, in Login_time, - host_name, to Program_name, + login_name, - Nt_user_name, the Last_request_start_time, * Last_request_end_time $ fromsys.dm_exec_sessionsPanax Notoginseng wheresession_idinch( About, $) - the Select --* + [session_id], A [blocking_session_id], the [Command], + [sql_handle], - text, $ [database_id], $ [Wait_type], - [Wait_time], - [Wait_resource] the fromsys.dm_exec_requests - CrossApply Sys.dm_exec_sql_text ([sql_handle])Wuyi whereblocking_session_id>0
SQL Transaction Isolation Learning