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

 

sqlserver刷新视图

上一篇:解决ojdbc6升级ojdbc8中文乱码问题


下一篇:SpringBoot使用sqlite数据库