sqlserver刷新视图

database

sqlserver 用于刷新当前数据库所有视图的存储过程

createprocedure dbo.proc_refreshview

as

begin

declare@viewnamevarchar(100)

declare cur_view cursorforselect[name]from sysobjects where[type]="V"

open cur_view

fetchnextfrom cur_view into@viewname

while(@@FETCH_STATUS=0)

begin

exec sp_refreshview @viewname

fetchnextfrom cur_view into@viewname

end

close cur_view

deallocate cur_view

end

 

以上是 sqlserver刷新视图 的全部内容, 来源链接: utcz.com/z/531457.html

回到顶部