If you have a simple select with updlock
statement as below:
select top 1 id
from customer with (updlock, serializable)
where guid = @guid;
will all the locks be acquired atomically during the select?
Or will it be acquired one by one, i.e. index lock first then row lock etc... thus prone to deadlock if the order of locks are acquired differently in another thread executing the same statement with a different guid or even the same guid?