SQL Server Inquiry not submitted, end of process, unlock the table lock

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.