SET TRANSACTION ISOLATION LEVEL REPEATABLE READ
BEGIN TRAN
DECLARE @UserCode VARCHAR(20)
SELECT TOP 1 @UserCode=usercode FROM dbo.tb_refUserCode With(RowLock,UpdLock) WHERE usestatus=0 --WHERE UserCode='19642428'
UPDATE dbo.tb_refUserCode SET UseStatus=1 WHERE UserCode=@UserCode
SELECT @UserCode
--waitfor delay '00:00:01'
COMMIT TRAN