首页 > 数据库技术 > 详细

sql server 更新视图的sp

时间:2014-09-26 17:21:39      阅读:292      评论:0      收藏:0      [点我收藏+]

create procedure RefreshAllView
as
begin
declare @ViewName varchar(250)
declare #views cursor for select name from sysobjects
where objectproperty(id,N‘IsView‘)=1 and uid=1 order by name
open #views
fetch next from #views into @viewname
while @@fetch_status=0
begin
print ‘正在更新: ‘+ @viewname
exec sp_refreshview @viewname --更新视图
fetch next from #views into @viewname
end
close #views
deallocate #views
end

sql server 更新视图的sp

原文:http://www.cnblogs.com/rxie/p/3994640.html

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