select top 20000 * from account UPDATE TOP (20000) account set result=1
select top 20000 这里把除result之外的列列出来,1 as result from accoun
--更新前 select * from account where id between 1 and 20000 --更新 update account set result=1 where id between 1 and 20000 --更新后 select * from account where result=1
create proc P_update as begin select top 20000 * from account UPDATE TOP (20000) account set result=1 end那就存储过程
UPDATE TOP (20000) account set result=1
--更新前
select * from account where id between 1 and 20000
--更新
update account set result=1 where id between 1 and 20000
--更新后
select * from account where result=1
as
begin
select top 20000 * from account
UPDATE TOP (20000) account set result=1
end那就存储过程