Sql Interview Question #4: What is the difference between an update lock and exclusive lock?


Sql Interview Question

What is the difference between an update lock and exclusive lock?

Solution

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.

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.

 

Thanks for reading this article,

Next steps :

  1. Share this with your colleagues because Sharing is Learning
  2. Comment below if you need any assistance