Table Locks : Prevent a table from getting updated while processing a job which does not necessarily update the table.

begin tran

declare @t table (id int)

insert into @t(id)
select BranchId from dbo.branch with (xlock, tablock)

commit

Until the transaction is committed Branch table will remain locked.

Advertisements