缺点是“与计划绑定"在SQL Server中? [英] Downsides to "WITH SCHEMABINDING" in SQL Server?

查看:103
本文介绍了缺点是“与计划绑定"在SQL Server中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个数据库,其中包含数百个笨拙的命名表(CG001T,GH066L等),并且每个数据库都有其友好"名称(视图"CUSTOMERS"为"SELECT * FROM GG120T"),例如).我想在视图中添加"WITH SCHEMABINDING",以便可以享受与之相关的一些优势,例如能够为视图建立索引,因为少数视图具有计算列,而这些列的计算成本很高./p>

SCHEMABINDING这些视图是否有缺点?我发现有些文章含蓄地暗示了这些缺点,但从未详细介绍.我知道,一旦视图绑定到架构,就不能在不先删除视图的情况下更改会影响视图的任何内容(例如,列数据类型或排序规则),那是一个问题,但除此之外吗?索引视图本身的功能似乎远远超过了更仔细地计划架构修改的缺点.

解决方案

完全没有.更安全我们到处都用它.

I have a database with hundreds of awkwardly named tables in it (CG001T, GH066L, etc), and I have views on every one with its "friendly" name (the view "CUSTOMERS" is "SELECT * FROM GG120T", for example). I want to add "WITH SCHEMABINDING" to my views so that I can have some of the advantages associated with it, like being able to index the view, since a handful of views have computed columns that are expensive to compute on the fly.

Are there downsides to SCHEMABINDING these views? I've found some articles that vaguely allude to the downsides, but never go into them in detail. I know that once a view is schemabound, you can't alter anything that would impact the view (for example, a column datatype or collation) without first dropping the view, so that's one, but aside from that? It seems that the ability to index the view itself would far outweigh the downside of planning your schema modifications more carefully.

解决方案

None at all. It's safer. we use it everywhere.

这篇关于缺点是“与计划绑定"在SQL Server中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆