首页 > 数据库技术 > 详细

Sql语句摘要

时间:2015-01-12 18:57:32      阅读:335      评论:0      收藏:0      [点我收藏+]

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

Sql语句摘要

原文:http://www.cnblogs.com/smileberry/p/4218855.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!