SQL Server ' has exceeded the lock request timeout period ' problem resolution

Source: Internet
Author: User
Tags session id

SQL sometimes encounters

The lock request time-out period has been exceeded. (Microsoft SQL Server, error: 1222)

This error, after refreshing, right-click on a table or library, found that the table is all disappeared or not query.
This is because the SQL process deadlock, the resource is preempted, to solve this problem, to kill the process of closing the deadlock, the following describes the solution:

The premise of the killing process is to find the deadlock process,

SELECT‘阻塞进程的ID‘‘等待时间(毫秒)‘‘(会话ID)‘FROM sys.dm_os_waiting_tasks

This SQL can query the ID of the current blocking process
So just kill these processes.

Kill SPID (process ID) or exec (' kill ' spid ')
So you can re-refresh the library, everything's fine.

By the way, there are two additional SQL related content:

--query information for the currently active lock manager resource  select  resource_type  ' resource type ' , Request_mode  ' request mode ' , request_type , Request_status  "request Status" , request_session_id  Session ID '  from  sys.dm_tran_locks   
--查询数据库进程(where 筛选库)select spId  from master..SysProcesseswhere db_Name(dbID) = ‘text‘ and spId <> @@SpId and dbID <> 0

SQL Server ' has exceeded the lock request timeout period ' problem resolution

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.