{"id":230,"date":"2021-03-02T12:21:49","date_gmt":"2021-03-02T12:21:49","guid":{"rendered":"https:\/\/datarebus.wordpress.com\/?p=230"},"modified":"2021-06-09T15:34:59","modified_gmt":"2021-06-09T15:34:59","slug":"set-lock_timeout","status":"publish","type":"post","link":"https:\/\/datarebus.com\/index.php\/2021\/03\/02\/set-lock_timeout\/","title":{"rendered":"SET LOCK_TIMEOUT"},"content":{"rendered":"\n<p>When any connection starts the value of the&nbsp;SET LOCK_TIMEOUT is -1, which means that the query has to wait for infinite time for the lock to be released on another query. If you want to simulate the scenario of&nbsp;SET LOCK_TIMEOUT to match NOWAIT query hint, it should be set to value 0.&nbsp;<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img src=\"https:\/\/datarebus.files.wordpress.com\/2021\/03\/image.png?w=473\" alt=\"\" class=\"wp-image-232\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img src=\"https:\/\/datarebus.files.wordpress.com\/2021\/03\/image-1.png?w=651\" alt=\"\" class=\"wp-image-234\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/blog.sqlauthority.com\/2013\/01\/28\/sql-server-basic-explanation-of-set-lock_timeout-how-to-not-wait-on-locked-query\/ <\/pre>\n\n\n\n<p>In this case, I have set the value of the&nbsp;SET LOCK_TIMEOUT to 2000 milliseconds. This query will wait for 2 seconds to another query to release the lock. If another query does not release the lock in 2 seconds, it will display the following error:<\/p>\n\n\n\n<p>Msg 1222, Level 16, State 45, Line 3<br>Lock request time out period exceeded.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When any connection starts the value of the&nbsp;SET LOCK_TIMEOUT is -1, which means that the query has to wait for infinite time for the lock to be released on another query. If you want to simulate the scenario of&nbsp;SET LOCK_TIMEOUT to match NOWAIT query hint, it should be set to value 0.&nbsp; \/\/blog.sqlauthority.com\/2013\/01\/28\/sql-server-basic-explanation-of-set-lock_timeout-how-to-not-wait-on-locked-query\/ In this [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,16],"tags":[],"_links":{"self":[{"href":"https:\/\/datarebus.com\/index.php\/wp-json\/wp\/v2\/posts\/230"}],"collection":[{"href":"https:\/\/datarebus.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/datarebus.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/datarebus.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/datarebus.com\/index.php\/wp-json\/wp\/v2\/comments?post=230"}],"version-history":[{"count":2,"href":"https:\/\/datarebus.com\/index.php\/wp-json\/wp\/v2\/posts\/230\/revisions"}],"predecessor-version":[{"id":1074,"href":"https:\/\/datarebus.com\/index.php\/wp-json\/wp\/v2\/posts\/230\/revisions\/1074"}],"wp:attachment":[{"href":"https:\/\/datarebus.com\/index.php\/wp-json\/wp\/v2\/media?parent=230"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/datarebus.com\/index.php\/wp-json\/wp\/v2\/categories?post=230"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/datarebus.com\/index.php\/wp-json\/wp\/v2\/tags?post=230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}