Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.\r\nOperation cancelled by user.\r\nThe statement has been terminated
怎么定位呢 使用如下查看sessionid
session_id, blocking_session_id, wait_type, wait_time, wait_resource, text
1 2
FROM sys.dm_exec_requests CROSS APPLY sys.dm_exec_sql_text(sql_handle);
但是这个是没用的
1 2 3 4 5 6 7 8 9 10
sELECT request_session_id AS SessionID, resource_type AS ResourceType, resource_database_id AS DatabaseID, resource_associated_entity_id AS AssociatedEntityID, request_mode AS LockMode, request_status AS LockStatus FROM sys.dm_tran_locks WHERE resource_type = 'OBJECT' OR resource_type = 'PAGE';
SELECT * FROM sys.dm_tran_locks SELECT * FROM sys.dm_exec_requests
SELECT cntr_value AS NumOfDeadLocks ,* FROM sys.dm_os_performance_counters WHERE object_name LIKE '%Locks%'
最后还是这个语句吧
1 2 3 4 5 6 7
select request_session_id spid,request_owner_type, OBJECT_NAME(resource_associated_entity_id) tableName,* from sys.dm_tran_locks where resource_type='OBJECT'