???????:SQL2012?з?????????????????????????????????????????????????????.????SQL2008R2??δ???????????????????????????????????????SQL Server????????????????????????-???????
???????????:??????????????????SQL Server(????汾)??????Щ???ν????????????????????????????????????????????.
??????????????????????????SQL2008R2?п?????update????м?????1-1
????Code ???????????
create table testlock
(ID varchar(10) primary key clustered??
col1 varchar(20)??
col2 char(200))
go----------create test table
declare @i int
set @i = 1
while @i < 100
begin
insert into testlock
select right(replicate('0'??10)+ cast(@i as varchar(10))??10)??'aaa'??'fixchar'
set @i = @i+1
end
go----------generate test data
????Code ???????
declare @ID nvarchar(10)
begin tran
select  top 1 @ID = ID from testlock with(updlock?? rowlock?? readpast)
where col1 = 'aaa'
order by id asc
select  @ID
waitfor delay '00:00:20'
update testlock set col1 = 'bbb' where id = @ID
commit tran


????
?1-1

??????????????SQL Server??????@ID???????????????????????????????д?????????????????????????Ч????????????????????????????????????????.
??????????????
????????ж????????????????????????????????CPU??IO???????????0????????????????С?仯?????????м???????????????????????估?????????????????????????м???.???1-2


????
?1-2