您现在的位置是: 首页 > 后端开发 SqlServer 刷新所有视图
SqlServer 刷新所有视图
2020-05-20 【后端开发】 1502人已围观 2569次浏览
简介SqlServer 刷新所有视图
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE procedure [dbo].[RefreshAllView]
as
begin
declare @ViewName varchar(250)
declare #views cursor for select name from sysobjects
where objectproperty(id,N’IsView’)=1
and objectproperty(id,N’IsSchemaBound’)=0 and uid=1 order by name
open #views
fetch next from #views into @viewname
while @@fetch_status=0
begin
begin try
exec sp_refreshview @viewname –更新视图
print ’更新成功: ’+ @viewname
end try
begin catch
print ’更新出错: ’+ @viewname + ’ ’ + ERROR_MESSAGE()
end catch
fetch next from #views into @viewname
end
close #views
deallocate #views
end
GO
很赞哦! (0)
相关文章
- Laravel项目出现could not be opened: failed to open stream: Permission denied
- SpringBoot @NotBlank 不生效问题
- 记一次Java MessageFormat.format踩坑
- Laravel Dingo/api 出现 The version given was unknown or has no registered routes.报错
- mac idea spring boot 启动慢
- SpringBoot 2.x Security security.basic.enabled=false 失效问题解决
- PHP 在执行 composer install 时出现提示 PHP Fatal error: Allowed memory size of XXXXXX bytes exhausted <...>
- SqlServer 优化技巧
- 类 BASE64Decoder 程序包 sun.misc 找不到符号
- 获取阿里云CDN真实IP
点击排行
- Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: ERR DISABLE You can't write or read against a disable instance
- RocketMQ 出现 sendDefaultImpl call timeout 问题
- Debian apt 使用国内镜像
- 类 BASE64Decoder 程序包 sun.misc 找不到符号
- SpringBoot @NotBlank 不生效问题
- 记一次 Mybatis-Plus 自动填充无效问题解决
- nuxt 项目完整部署方案
- SpringBoot 2.x 文件上传出现 The field file exceeds its maximum permitted size of 1048576 bytes
站长推荐
猜你喜欢
- Laravel Dingo/api 出现 The version given was unknown or has no registered routes.报错
- 【代码片段】MySQL 查看数据库所有表注释
- Nestedset 出现 Node must exists. 错误解决方案
- idea去掉Smart commands execution提示
- Vue 监听回车 el-input 和 input 使用方法不同
- RocketMQ 出现 sendDefaultImpl call timeout 问题
- Mac 设置允许任何来源
- Python 钉钉加签 HmacSHA256 算法签名
- Android SDK版本号与API级别的对照表
- ElasticSearch安装踩坑指南