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

 

相关文章:

  • 2022-01-28
  • 2021-07-08
  • 2021-05-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-01
猜你喜欢
  • 2022-01-10
  • 2021-05-20
  • 2021-07-18
  • 2022-12-23
  • 2022-12-23
  • 2022-01-01
  • 2021-05-22
相关资源
相似解决方案