Меню

Lock request time out period exceeded microsoft sql server ошибка 1222

SQL Server 2012 Enterprise SQL Server 2012 Developer SQL Server 2012 Standard More…Less

Microsoft SQL Server 2012 Service Pack 1 fixes have been released as one downloadable file. Given that the fixes are cumulative, each new release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2012 Service Pack 1 fix release.

Symptoms

When you use SQL Server Service Broker in Microsoft SQL Server 2012, the following error 1222 is logged multiple times in the SQL Server error log:

An error occurred in Service Broker internal activation while trying to scan the user queue ‘Queue_name‘ for its status. Error: 1222, State: 51. Lock request time out period exceeded. This is an informational message only. No user action is required

Resolution

Service Pack 2 information for SQL Server 2012

Cumulative update information

Cumulative Update 4 for SQL Server 2012 SP1

The fix for this issue was first released in Cumulative Update 4. For more information about how to obtain this cumulative update package for SQL Server 2012 SP1, click the following article number to go to the article in the Microsoft Knowledge Base:

2833645 Cumulative update 4 for SQL Server 2012 SP1Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2012 SP1 fix release. We recommend that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to go to the article in the Microsoft Knowledge Base:

2772858 The SQL Server 2012 builds that were released after SQL Server 2012 Service Pack 1 was released

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the «Applies to» section.

References

For more information about the Incremental Servicing Model for SQL Server, click the following article number to go to the article in the Microsoft Knowledge Base:

935897 An Incremental Servicing Model is available from the SQL Server team to deliver hotfixes for reported problems For more information about the naming schema for SQL Server updates, click the following article number to go to the article in the Microsoft Knowledge Base:

822499 Naming schema for Microsoft SQL Server software update packages For more information about software update terminology, click the following article number to go to the article in the Microsoft Knowledge Base:

824684 Description of the standard terminology that is used to describe Microsoft software updates

Need more help?

I am working in a database where I load data in a raw table by a data loader. But today the data loader got stuck for unknown reasons. Then I stopped the data loader from windows task manager. But then I again tried to load data in the raw table but found its locked and I can’t do any operation on it. I tried restarting SQL Server service but it was not resolved. And I have no permission to kill processes on this server.

Below is the message showed by SQL Server.

An exception occurred while executing a Transact-SQL statement or
batch. (Microsoft.SqlServer.ConnectionInfo)

Program Location:

at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String
sqlCommand, ExecutionTypes executionType)
at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(StringCollection
sqlCommands, ExecutionTypes executionType)
at Microsoft.SqlServer.Management.Smo.ExecutionManager.ExecuteNonQuery(StringCollection
queries)
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.ExecuteNonQuery(StringCollection
queries, Boolean includeDbContext)
at Microsoft.SqlServer.Management.Smo.NamedSmoObject.RenameImplWorker(String
newName)
at Microsoft.SqlServer.Management.Smo.NamedSmoObject.RenameImpl(String
newName)

===================================

Lock request time out period exceeded. Either the parameter @objname
is ambiguous or the claimed @objtype (OBJECT) is wrong. (.Net
SqlClient Data Provider)


Server Name: 162.44.25.59
Error Number: 1222
Severity: 16 State: 56
Procedure: sp_rename Line Number: 282

My SQL Server version is 2008 R2.

halfer's user avatar

halfer

19.7k17 gold badges94 silver badges182 bronze badges

asked Nov 24, 2011 at 14:35

user960340's user avatar

3

In the SQL Server Management Studio,
to find out details of the active transaction, execute following command

DBCC opentran()

You will get the detail of the active transaction, then from the SPID of the active transaction, get the detail about the SPID using following commands

exec sp_who2 <SPID>
exec sp_lock <SPID>

For example, if SPID is 69 then execute the command as

exec sp_who2 69
exec sp_lock 69

Now , you can kill that process using the following command

KILL 69

user's user avatar

user

3,8965 gold badges17 silver badges34 bronze badges

answered Feb 28, 2014 at 10:06

AbdulRahman Ansari's user avatar

5

It’s been a while, but last time I had something similar:

ROLLBACK TRAN

or trying to

COMMIT

what had allready been done free’d everything up so I was able to clear things out and start again.

answered Nov 25, 2011 at 15:18

shawty's user avatar

shawtyshawty

5,6992 gold badges34 silver badges71 bronze badges

2

To prevent this, make sure every BEGIN TRANSACTION has COMMIT

The following will say successful but will leave uncommitted transactions:

BEGIN TRANSACTION
BEGIN TRANSACTION
<SQL_CODE?
COMMIT

Closing query windows with uncommitted transactions will prompt you to commit your transactions. This will generally resolve the Error 1222 message.

codingbiz's user avatar

codingbiz

25.9k8 gold badges55 silver badges94 bronze badges

answered Jan 27, 2016 at 22:01

Paul Totzke's user avatar

Paul TotzkePaul Totzke

1,43017 silver badges31 bronze badges

I had these SQL behavior settings enabled on options query execution: ANSI SET IMPLICIT_TRANSACTIONS checked. On execution of your query e.g create, alter table or stored procedure, you have to COMMIT it.

Just type COMMIT and execute it F5

marc_s's user avatar

marc_s

721k173 gold badges1320 silver badges1442 bronze badges

answered Jun 27, 2019 at 13:38

Jerry Iriri's user avatar

In my case, I was trying to disable a trigger on a table when I received error 1222 «Lock request time out period exceeded.»

I followed suggestions in this answer:

  1. Open two query windows in SSMS.
  2. In the first, type/paste the command that is timing out (due to a lock). In the lower right hand corner of SSMS, you should see the username and (in parentheses) the SPID of the connection you’re using. Note the SPID of this query window connection. Don’t execute this query just yet.
  3. In the second query window, type/paste SELECT * FROM sysprocesses WHERE spid = <SPID you noted in step 2>
  4. Execute the first query that is timing out, and while it is executing (but before it times out) switch over to the second query window and execute it (the SELECT * from sysprocesses... one)
  5. You should get some results in the results pane. Look at the ‘blocked’ field in the results. In my case, it contained the SPID of the process that was locking the table.
  6. Research the locking process further by executing SELECT * FROM sysprocesses WHERE spid = <SPID from the ‘blocked’ field in step 5>.
  7. If the locking process can be safely terminated, kill it with kill <locking SPID>

answered May 25, 2021 at 21:30

Baodad's user avatar

BaodadBaodad

2,3352 gold badges37 silver badges39 bronze badges

  • Remove From My Forums
  • Question

  • We’re running a SQL-Server 2012 and for a while now my accessing records from bigger tables became tricky.

    There is a Tomcat-8 running which sometimes can’t access these tables at all or only after a long delay. As this happened first I went to the Server-Room and opened the Database with the Management Studio to see if there were any issues. Strangely I could
    open the Database but expanding the directories for «Tables» or «Views» failed after 10 Seconds with the Error 1222.

    I turned the Tomcat-8 off to find out whether some unclosed connections are open. Same result, no changes even after one hour.

    Another 3rd-Party program which we are using seems to connect via other mechanisms to the SQL-Server (Is there a way to list current connections and their types in the Management-Studio, please let me know so I’m able to provide this information too) But
    I’m under the impression this program does a lot of caching, it’s much faster than the Management-Studio itself.

    The question is now how can I find out why these time-outs happen? I’m not an expert in SQL-Servers so please let me know how I can provide missing information.

    Thank you

Answers

  • I don’t think there is a way to configure that lock timeout of 10 seconds. By default, there is no lock timeout in SQL Server, but it is possible that Object Explorer in SSMS sets one up, so it will remain unresponsive forever if there is blocking.

    The information given is quite vague, and I am not at all acquainted with Tomcat-8. I have a procedure on my web site which is good for analysing blocking situations and the ongoing activity in the server. You may find it useful:
    http://www.sommarskog.se/sqlutil/beta_lockinfo.html


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

    • Marked as answer by

      Saturday, October 24, 2015 4:01 PM

Stuck with an error 1222 microsoft sql server? Bobcares is at your service!

The error 1222 is a common error when you are working in Microsoft SQL Server Management Studio. It often pops up when you are attempting to view tables, procedures, or tables in object explorer. Find out how our Support engineers helped out a customer with their SQL server 1222 error recently.

What is MS SQL server error 1222?

The error is a result of a longer query wait time than lock timeout settings. The lock timeout indicates the time spent waiting for a backend resource to be available.

Fortunately, the Support Engineers at Bobcares have a quick fix for this.

Tips to resolve the pesky error 1222 Microsoft SQL server

Now that you have got an idea about why error 1222 pops up. Let’s dive into resolving the issue once and for all.

  1. Our engineers use sp_who2 to check the currently established sessions in the database as well as any sessions with high CPU usage, blocking, high I/O usage, or sessions with multiple entries for identical SPID. This may be the cause behind lock time-outs.
  2. You can change the lock time-out period by running the following command:
     SET LOCK_TIMEOUT timeout_period

    The timeout_period indicates the number of milliseconds allowed to pass before a locking error is returned by Microsoft SQL Server. Its default value is  -1, which specifies no time-out period. Changing the lock time-out period will prevent error 1222 from occurring frequently.

[Looking for assistance with Server Management? We are just a click away]

Conclusion

This easy fix to resolve Microsoft SQL server management studio error 1222 tip comes from our top experts at Bobcares.
If you have any queries about your SQL server or server management, do not hesitate to contact us. We have been helping customers successfully resolve issues related to server management for a long time.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

  • Remove From My Forums
  • Question

  • Hi All,

    Lock request time out period exceeded, error 1222" will appear when I try to expand the tables list in database in SQL Server Management Studio 2012 (Enterprises).

    I am creating partition on my table which is having more than 200 million records. Initially I thought this is happening due to ONLINE=OFF option is set for cluster index which will partition the existing table. But this is not true. I tried with ONLINE=ON & still I can see same problem.

    Below is the index which I am running to Partition my table:

    USE [MY_DB]
    GO
    BEGIN TRANSACTION

    CREATE CLUSTERED INDEX [TRANS_PS_635112970545378233] ON [dbo].[Table]
    (
    [Date]
    )WITH (SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF) ON [MY_PS]([Date])

    DROP INDEX [TRANS_PS_635112970545378233] ON [dbo].[Table]

    COMMIT TRANSACTION

    After running this query which is taking around 9-10 hours I am getting error: "Lock request time out period exceeded. (Microsoft SQL Server, Error: 1222)" when I try to expand the tables list in database in SQL Server Management Studio 2012 (Enterprises)

    My DBA suggested that need to snapshot_isolation_state =1 in sys.databases( SELECT * FROM sys.databases) at DB level. I am not sure so looking for opinion.

    http://technet.microsoft.com/en-us/library/ms178534.aspx


    Thanks Shiven:) If Answer is Helpful, Please Vote

    • Edited by

      Monday, August 5, 2013 7:51 AM

    • Moved by
      Kalman Toth
      Monday, August 5, 2013 7:53 AM
      Not db design

Answers

  • This is normal and expected behavior in SSMS.

    You are creating an index, locking the table.  SSMS is unable to get the data about the tables,columns, indexes.  This is how it works.  You need to wait for the indexing to complete.

    • Proposed as answer by
      Tom Phillips
      Wednesday, August 7, 2013 6:26 PM
    • Marked as answer by
      Allen Li — MSFT
      Tuesday, August 13, 2013 11:11 PM

Содержание

  1. KB2837910 — FIX: Error 1222 when you use Service Broker in SQL Server 2012
  2. Symptoms
  3. Resolution
  4. Service Pack 2 information for SQL Server 2012
  5. Cumulative update information
  6. Cumulative Update 4 for SQL Server 2012 SP1
  7. Status
  8. References
  9. Error 1222 Microsoft SQL server: Resolved
  10. What is MS SQL server error 1222?
  11. Tips to resolve the pesky error 1222 Microsoft SQL server
  12. Conclusion
  13. PREVENT YOUR SERVER FROM CRASHING!
  14. Исправление: Ошибка при использовании компонента Service Broker в SQL Server 2012 1222
  15. Симптомы
  16. Решение
  17. Сведения о Пакет обновления 2 для SQL Server 2012
  18. Информация о накопительном пакете обновления
  19. Накопительное обновление 4 для SQL Server 2012 с пакетом обновления 1
  20. Статус
  21. Ссылки
  22. KB2837910 — FIX: Error 1222 when you use Service Broker in SQL Server 2012
  23. Symptoms
  24. Resolution
  25. Service Pack 2 information for SQL Server 2012
  26. Cumulative update information
  27. Cumulative Update 4 for SQL Server 2012 SP1
  28. Status
  29. References
  30. MSSQLSERVER_1222
  31. Сведения
  32. Объяснение
  33. Действие пользователя

KB2837910 — FIX: Error 1222 when you use Service Broker in SQL Server 2012

Microsoft SQL Server 2012 Service Pack 1 fixes have been released as one downloadable file. Given that the fixes are cumulative, each new release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2012 Service Pack 1 fix release.

Symptoms

When you use SQL Server Service Broker in Microsoft SQL Server 2012, the following error 1222 is logged multiple times in the SQL Server error log:

An error occurred in Service Broker internal activation while trying to scan the user queue ‘ Queue_name‘ for its status. Error: 1222, State: 51. Lock request time out period exceeded. This is an informational message only. No user action is required

Resolution

Service Pack 2 information for SQL Server 2012

To resolve this issue, obtain the Service Pack 2 for SQL Server 2012. For more information, see Bugs that are fixed in SQL Server 2012 Service Pack 2 and How to obtain the latest service pack for SQL Server 2012.

Cumulative update information

Cumulative Update 4 for SQL Server 2012 SP1

The fix for this issue was first released in Cumulative Update 4. For more information about how to obtain this cumulative update package for SQL Server 2012 SP1, click the following article number to go to the article in the Microsoft Knowledge Base:

2833645 Cumulative update 4 for SQL Server 2012 SP1Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2012 SP1 fix release. We recommend that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to go to the article in the Microsoft Knowledge Base:

2772858 The SQL Server 2012 builds that were released after SQL Server 2012 Service Pack 1 was released

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the «Applies to» section.

References

For more information about the Incremental Servicing Model for SQL Server, click the following article number to go to the article in the Microsoft Knowledge Base:

935897 An Incremental Servicing Model is available from the SQL Server team to deliver hotfixes for reported problems For more information about the naming schema for SQL Server updates, click the following article number to go to the article in the Microsoft Knowledge Base:

822499 Naming schema for Microsoft SQL Server software update packages For more information about software update terminology, click the following article number to go to the article in the Microsoft Knowledge Base:

824684 Description of the standard terminology that is used to describe Microsoft software updates

Источник

Error 1222 Microsoft SQL server: Resolved

by Nikhath K | Sep 10, 2021

Stuck with an error 1222 microsoft sql server? Bobcares is at your service!

The error 1222 is a common error when you are working in Microsoft SQL Server Management Studio. It often pops up when you are attempting to view tables, procedures, or tables in object explorer. Find out how our Support engineers helped out a customer with their SQL server 1222 error recently.

What is MS SQL server error 1222?

The error is a result of a longer query wait time than lock timeout settings. The lock timeout indicates the time spent waiting for a backend resource to be available.

Fortunately, the Support Engineers at Bobcares have a quick fix for this.

Tips to resolve the pesky error 1222 Microsoft SQL server

Now that you have got an idea about why error 1222 pops up. Let’s dive into resolving the issue once and for all.

  1. Our engineers use sp_who2 to check the currently established sessions in the database as well as any sessions with high CPU usage, blocking, high I/O usage, or sessions with multiple entries for identical SPID. This may be the cause behind lock time-outs.
  2. You can change the lock time-out period by running the following command:

The timeout_period indicates the number of milliseconds allowed to pass before a locking error is returned by Microsoft SQL Server. Its default value is -1, which specifies no time-out period. Changing the lock time-out period will prevent error 1222 from occurring frequently.

[Looking for assistance with Server Management? We are just a click away]

Conclusion

This easy fix to resolve Microsoft SQL server management studio error 1222 tip comes from our top experts at Bobcares.
If you have any queries about your SQL server or server management, do not hesitate to contact us. We have been helping customers successfully resolve issues related to server management for a long time.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

Источник

Исправление: Ошибка при использовании компонента Service Broker в SQL Server 2012 1222

Пакет обновления 1 для Microsoft SQL Server 2012 исправления были выпущены как один загружаемый файл. Учитывая, что исправления являются накопительными, каждый выпуск содержит все исправления и все исправления безопасности, которые были включены в Пакет обновления 1 для предыдущего SQL Server 2012 выпуска исправлений.

Симптомы

При использовании компонента SQL Server Service Broker в Microsoft SQL Server 2012, несколько раз регистрируется следующее сообщение об ошибке 1222 в журнале ошибок SQL Server.

Произошла ошибка внутренней активации компонента Service Broker при попытке проверить очередь пользователя « Имя_очереди» для его состояние. Ошибка: 1222, состояние: 51. Блокировки время ожидания запроса превышено. Это информационное сообщение. Не требуется никаких действий пользователя

Решение

Сведения о Пакет обновления 2 для SQL Server 2012

Чтобы устранить эту проблему, получите в Пакет обновления 2 для SQL Server 2012. Дополнительные сведения содержатся в разделе ошибок, которые входят в Пакет обновления 2 для SQL Server 2012 и как получить последний пакет обновления для SQL Server 2012.

Информация о накопительном пакете обновления

Накопительное обновление 4 для SQL Server 2012 с пакетом обновления 1

Исправление, устраняющее эту проблему, сначала было выпущено в накопительное обновление 4. Дополнительные сведения о том, как получить этот накопительный пакет обновления для SQL Server 2012 с пакетом обновления 1 щелкните следующий номер статьи, чтобы перейти к статье базы знаний Майкрософт:

2833645 накопительного обновления 4 для SQL Server 2012 с пакетом обновления 1Примечание. Поскольку построения являются накопительными, каждый новый выпуск исправление содержит все исправления и все исправления, входившие в состав предыдущих SQL Server 2012 с пакетом обновления 1 выпуска исправлений. Мы рекомендуем рассмотреть применение последнего выпуска исправления, содержащего это исправление. Для получения дополнительных сведений щелкните следующий номер статьи, чтобы перейти к статье базы знаний Майкрософт:

2772858 SQL Server 2012 выполняется построение, выпущенных после выпуска SQL Server 2012 Пакет обновления 1

Статус

Корпорация Майкрософт подтверждает, что это проблема продуктов Майкрософт, перечисленных в разделе «Относится к».

Ссылки

Дополнительные сведения о добавочных модель обслуживания для SQL Server щелкните следующий номер статьи, чтобы перейти к статье базы знаний Майкрософт:

935897 добавочных модель обслуживания доступна из группы SQL Server для предоставления исправления для проблем, о которых сообщалось вДополнительные сведения о схеме именования для обновления SQL Server щелкните следующий номер статьи, чтобы перейти к статье базы знаний Майкрософт:

Пакеты обновлений схемы именования 822499 для программного обеспечения Microsoft SQL ServerДополнительные сведения о терминологии обновления программного обеспечения щелкните следующий номер статьи, чтобы перейти к статье базы знаний Майкрософт:

Описание 824684 Стандартные термины, используемые при описании обновлений программных продуктов Майкрософт

Источник

KB2837910 — FIX: Error 1222 when you use Service Broker in SQL Server 2012

Microsoft SQL Server 2012 Service Pack 1 fixes have been released as one downloadable file. Given that the fixes are cumulative, each new release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2012 Service Pack 1 fix release.

Symptoms

When you use SQL Server Service Broker in Microsoft SQL Server 2012, the following error 1222 is logged multiple times in the SQL Server error log:

An error occurred in Service Broker internal activation while trying to scan the user queue ‘ Queue_name‘ for its status. Error: 1222, State: 51. Lock request time out period exceeded. This is an informational message only. No user action is required

Resolution

Service Pack 2 information for SQL Server 2012

To resolve this issue, obtain the Service Pack 2 for SQL Server 2012. For more information, see Bugs that are fixed in SQL Server 2012 Service Pack 2 and How to obtain the latest service pack for SQL Server 2012.

Cumulative update information

Cumulative Update 4 for SQL Server 2012 SP1

The fix for this issue was first released in Cumulative Update 4. For more information about how to obtain this cumulative update package for SQL Server 2012 SP1, click the following article number to go to the article in the Microsoft Knowledge Base:

2833645 Cumulative update 4 for SQL Server 2012 SP1Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2012 SP1 fix release. We recommend that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to go to the article in the Microsoft Knowledge Base:

2772858 The SQL Server 2012 builds that were released after SQL Server 2012 Service Pack 1 was released

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the «Applies to» section.

References

For more information about the Incremental Servicing Model for SQL Server, click the following article number to go to the article in the Microsoft Knowledge Base:

935897 An Incremental Servicing Model is available from the SQL Server team to deliver hotfixes for reported problems For more information about the naming schema for SQL Server updates, click the following article number to go to the article in the Microsoft Knowledge Base:

822499 Naming schema for Microsoft SQL Server software update packages For more information about software update terminology, click the following article number to go to the article in the Microsoft Knowledge Base:

824684 Description of the standard terminology that is used to describe Microsoft software updates

Источник

MSSQLSERVER_1222

Применимо к: SQL Server (все поддерживаемые версии)

Сведения

attribute Значение
Название продукта SQL Server
Идентификатор события 1222
Источник события MSSQLSERVER
Компонент SQLEngine
Символическое имя LK_TIMEOUT
Текст сообщения Истекло время ожидания запроса на блокировку.

Объяснение

Другая транзакция удерживает блокировку требуемого ресурса дольше, чем данный запрос может ее ожидать.

Действие пользователя

Для решения проблемы попробуйте выполнить следующие задачи.

Если это возможно, найдите на требуемом ресурсе транзакцию, удерживающую эту блокировку. Используйте динамические административные представления sys.dm_os_waiting_tasks и sys.dm_tran_locks.

Если транзакция все еще удерживает блокировку, завершите эту транзакцию, если это адекватно.

Выполните запрос еще раз.

Если данная ошибка возникает часто, измените время ожидания блокировки или вызывающие ошибку транзакции так, чтобы они удерживали блокировку на меньший период времени.

Источник

Question: I’m on SSMS and trying to access the SQL Server instance but I’m getting this error:

Lock request timeout period exceedd Error 1222

Normally I can access the server and there haven’t been any security changes. What could be causing this problem?

Answer: The basis of the Error 1222 is that a transactions is holding a lock on the target resource for a longer period than the query could wait for.

There are different situations that can trigger the error message.

Example 1 : Someone running a transaction with a BEGIN TRAN but no ROLLBACK or COMMIT. The transaction could be locking the system tables.

The quickest way to sort out the issue is to identify the active transaction details.

In the SQL Server Management Studio, to find out details of the active transaction, execute following command

DBCC opentran()

for more details read:

 SQL Server — SQL open transactions and how to find

SQL Server — How to find Open Transactions

If you think you’re creating the issue through a transaction executed through the SSMS, you could shut the SSMS. Slightly drastic , but it will normally solve your problem

Author: Tom Collins (http://www.sqlserver-dba.com)

Share:

As the error says error 1222 lock request time out period exceeded, it occurs when a query waits longer than the lock timeout setting. The lock timeout setting is the time in millisecond a query waits on a blocked resource and it returns error when the wait time exceeds the lock time out setting. The default value of LOCK TIMEOUT is -1.

Let’s now replicate the issue. The below query begins a transaction and executes and update command on Person.Person table however, it doesn’t completes the transaction; the transaction is in open state.

BEGIN TRAN
GO
UPDATE Person.Person SET Suffix='Mr' 
WHERE BusinessEntityID between 10 and 100

Open a second query window and run below query. The query executes a select statement on Person.Person table with LOCK TIMEOUT setting of 10 millisecond.

SET lock_timeout 10
GO
select * from 
 Person.Person  
where BusinessEntityID  between 10 and 100

sql server error 1222 lock request time out

The query fails with Lock request time out period exceeded error. The select query waits on update query for 10 ms and then terminates as the lock on Person.Person table is not released.

The short term or quick resolution for this issue is to commit/rollback open transaction and then fix the issue with the blocking/long running query.

Like us on FaceBook  |  Join the fastest growing SQL Server group on FaceBook

0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • Loch ошибка на стиральной машине хаер
  • Ls 0006 ошибка epic games gta 5