Hi, I have the below view
CREATE VIEW vwEmployee AS SELECT TOP 1 ID, DateAdded FROM DB1.dbo.tblEmployee WITH (UPDLOCK, READPAST) ORDER BY ID ASC, DateAdded ASC
when I run something like
begin transaction select * from vwEmployee waitfor delay '00:00:05' commit
usually there has to be update lock on only 1 row in the table. But I see Update lock on each row of the table. When I run the same query on the table
select top 1 * FROM DB1.dbo.tblEmployee WITH (UPDLOCK, READPAST) ORDER BY ID ASC, DateAdded ASC
I see the update lock is only on 1 row. So what I m missing here? Can someone please shed light on this? Thank you