﻿{"id":288,"date":"2014-10-16T17:30:46","date_gmt":"2014-10-16T16:30:46","guid":{"rendered":"http:\/\/www.codereview.co\/?p=288"},"modified":"2014-10-15T14:51:03","modified_gmt":"2014-10-15T13:51:03","slug":"sql-interview-question-4-what-is-the-difference-between-an-update-lock-and-exclusive-lock","status":"publish","type":"post","link":"http:\/\/www.codereview.co\/index.php\/sql-server-tutorials\/sql-interview-question-4-what-is-the-difference-between-an-update-lock-and-exclusive-lock\/","title":{"rendered":"Sql Interview Question #4: What is the difference between an update lock and exclusive lock?"},"content":{"rendered":"<p><span style=\"color: #000000;\"><strong>Sql Interview Question<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\"> What is the difference between an update lock and exclusive lock?<\/span><!--more--><\/p>\n<p><span style=\"color: #000000;\"><strong>Solution<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">When exclusive lock is on any process, no other lock can be placed on that row or table. Every other process has to wait until the exclusive lock completes its tasks.<\/span><\/p>\n<p><span style=\"color: #000000;\">An update lock is a type of exclusive lock, except that it can be placed on the row which already has shared lock on it. Update lock reads the data of the row which has the shared lock. As soon as the update lock is ready to change the data it converts itself to the exclusive lock.<\/span><\/p>\n<p><span style=\"color: #000000;\">\u00a0<\/span><\/p>\n<p><span style=\"color: #000000;\"><strong>Thanks for reading this article,<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\"><strong>Next steps :<\/strong><\/span><\/p>\n<ol>\n<li><span style=\"color: #000000;\"><strong>Share this with your colleagues because Sharing is Learning<\/strong><\/span><\/li>\n<li><span style=\"color: #000000;\"><strong>Comment below if you need any assistance<\/strong><\/span><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Sql Interview Question What is the difference between an update lock and exclusive lock?<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[172,3],"tags":[150,149,147,13,12,148],"_links":{"self":[{"href":"http:\/\/www.codereview.co\/index.php\/wp-json\/wp\/v2\/posts\/288"}],"collection":[{"href":"http:\/\/www.codereview.co\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.codereview.co\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.codereview.co\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.codereview.co\/index.php\/wp-json\/wp\/v2\/comments?post=288"}],"version-history":[{"count":3,"href":"http:\/\/www.codereview.co\/index.php\/wp-json\/wp\/v2\/posts\/288\/revisions"}],"predecessor-version":[{"id":363,"href":"http:\/\/www.codereview.co\/index.php\/wp-json\/wp\/v2\/posts\/288\/revisions\/363"}],"wp:attachment":[{"href":"http:\/\/www.codereview.co\/index.php\/wp-json\/wp\/v2\/media?parent=288"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.codereview.co\/index.php\/wp-json\/wp\/v2\/categories?post=288"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.codereview.co\/index.php\/wp-json\/wp\/v2\/tags?post=288"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}