标签:
1.分批更新数据库
declare @x int
set @x=1
while(@x<=51)
begin
begin tran
update UserFavorite set UserFavorite.firstpublishtime = product.lastpublishtime
from UserFavorite,product where UserFavorite.productid = product.id
and UserFavorite.id between (@x-1)* 10000 and @x*10000
commit tran
set @x=@x+1
WAITFOR DELAY ‘00:00:30‘; --等待5秒
end
标签:
原文地址:http://www.cnblogs.com/smileberry/p/4218855.html