sql-server – 为什么SQL Server存储过程的表值参数需要输入READONLY?

前端之家收集整理的这篇文章主要介绍了sql-server – 为什么SQL Server存储过程的表值参数需要输入READONLY?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
任何人都可以解释防止表值参数被设置为存储过程的输出参数背后的设计决策吗?

我无法计算我开始构建数据模型的次数,希望完全锁定我的表到外部访问(你知道……实现细节),只允许应用程序通过存储过程访问数据库(你知道……数据接口)并与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.

原文链接:https://www.f2er.com/mssql/83490.html

猜你在找的MsSQL相关文章