USE Northwind BEGIN TRAN SELECT * FROM dbo.Categories (UPDLOCK,ROWLOCK) WHERE CategoryID=3- select number 2, run this
USE Northwind BEGIN TRAN SELECT * FROM dbo.Categories (UPDLOCK,ROWLOCK) WHERE CategoryID=3 ROLLBACKYou can see session 2 i locked
ROLLBACK
You can see session 2 continue