If there are uncommitted tasks in the repository, the related table will always be in a deadlock state and will affect other processes (unless used with (NOLOCK) in the enquiry).
Because of the isolation of the task, the other session can not simply pass through the rollback transaction to roll the task, and only finally did not submit the task of the progress of the conversation, and then because of the atomic nature of the mission, eventually its progress, the task will be rolled back.
How do I find out about uncommitted tasks?
Run the following command:
DBCC OpenTran
The results are as follows:
The SPID is the process ID, then the following command, the final process can be:
-- 52就是未提交事務會話所在SPID
Other enquiries:
-- 查詢鎖定的表select object_name(P.object_id) as TableName, resource_type, resource_description,request_session_id,L.resource_database_idfrom sys.dm_tran_locks L join sys.partitions P on L.resource_associated_entity_id = p.hobt_idWHERE L.resource_database_id = DB_ID() -- 查詢阻塞(Blocked)進程SELECT * FROM sys.dm_exec_requests WHERE blocking_session_id<>0
SQL Server Inquiry not submitted, end of process, unlock the table lock