gpt4 book ai didi

sql-server - 为什么需要以只读方式输入 SQL Server 存储过程的表值参数?

转载 作者:行者123 更新时间:2023-12-03 14:35:10 27 4
gpt4 key购买 nike

谁能解释防止表值参数被指定为存储过程的输出参数的设计决策?

我数不清有多少次我开始构建一个数据模型,希望完全锁定我的表以供外部访问(你知道......实现细节),仅通过存储过程授予应用程序访问数据库的权限(你知道...数据接口(interface))并与 TVP 来回通信只是让 SSMS 称我为顽皮,因为我大胆地认为我可以使用用户定义的表类型作为我的数据服务和我的应用程序之间的传输对象。

所以有人请给我一个很好的理由,为什么 TVP 被设计为只读输入参数。

最佳答案

Optimizing Microsoft SQL Server 2008 Applications Using Table Valued Parameters, XML, and MERGE 上的演示文稿中Michael Rys 他说。 (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.

关于sql-server - 为什么需要以只读方式输入 SQL Server 存储过程的表值参数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26540923/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com