sqlserver刷新视图


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

create procedure dbo.proc_refreshview
as
begin
    declare @viewname varchar(100)
    declare cur_view cursor for select [name] from sysobjects where [type]='V'
    open cur_view
    fetch next from cur_view into @viewname
    while(@@FETCH_STATUS=0)
    begin
        exec sp_refreshview @viewname

        fetch next from cur_view into @viewname
    end
    close cur_view
    deallocate cur_view
end

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM