The database was not responding to simple select statements like
select * from table
I noticed in sys.dm_os_waiting_tasks that one session is blocking, blocking session was pointing to a stored procedure which use lock & Tran like below
BEGIN TRAN
declare @min numeric ,@com numeric
select top 1 @com=companyid from tblcompanies
order by newid()
select @min=min(productid) from tblproducts(UPDLOCK)
where companyid=@com and (lockstatus<>1 or lockstatus is null )
update tblproducts
set lockStatus='1'
where productid>=@min and productid<@min+4
select distinct top 4 s.productname,s.productid,s.companyid,r.Type,r.requestType,r.UserID
from tblcompanydetail rd inner join tblproducts s
on rd.productid=s.productid
inner join tblcompanies r
on r.companyid=s.companyid
where s.productid>=@min and s.productid<@min+4
if @@error >0 rollback tran
commit tran
Please advise me if I have written it wrong.