任何人都可以解释防止表值参数被设置为存储过程的输出参数背后的设计决策吗?
我无法计算我开始构建数据模型的次数,希望完全锁定我的表到外部访问(你知道……实现细节),只允许应用程序通过存储过程访问数据库(你知道……数据接口)并与TVP来回沟通只是为了让SSMS称我顽皮,因为我大胆地认为我可以使用用户定义的表类型作为我的数据服务和我的应用程序之间的传输对象.
所以有人请告诉我为什么TVP被设计为只读输入参数.
解决方法
在迈克尔·雷斯的
Optimizing Microsoft SQL Server 2008 Applications Using Table Valued Parameters,XML,and MERGE演讲中,他说. (在32:52)
Note that in SQL Server 2008 table valued parameters are read only. But as you notice we actually require you to write READONLY. So that actually then means that at some point in the future maybe if you say please,please please often enough we might be able to actually make them writable as well at some point. But at the moment they are read only.
这是您应该用来添加“请”的连接项. Relax restriction that table parameters must be readonly when SPs call each other.
Srini Acharya对连接项进行了评论.
Allowing table valued parameters to be read/write involves quite a bit of work on the SQL Engine side as well as client protocols. Due to time/resource constraints as well as other priorirites,we will not be able to take up this work as part of SQL Server 2008 release. However,we have investigated this issue and have this firmly in our radar to address as part of the next release of SQL Server.
(编辑:李大同)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|