加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MsSql教程 > 正文

数据库 – 存储过程的缺点

发布时间:2020-12-12 07:03:28 所属栏目:MsSql教程 来源:网络整理
导读:想获得使用存储过程的优缺点列表。 SP的主要优点似乎是预编译的,并且是应用程序中的数据抽象。给我你的想法…. 解决方法 更正:是否预编译取决于数据库。例如,在SQL Server中,它们不是。存储过程和参数化SQL都在运行之前进行编译。存储过程有时可以重新使
想获得使用存储过程的优缺点列表。 SP的主要优点似乎是预编译的,并且是应用程序中的数据抽象。给我你的想法….

解决方法

更正:是否预编译取决于数据库。例如,在SQL Server中,它们不是。存储过程和参数化SQL都在运行之前进行编译。存储过程有时可以重新使用执行计划,如果存在相应的存储过程,那么参数化SQL也是如此。

编辑:Here’s what MSDN says about it:

SQL Server 2000 and SQL Server version 7.0 incorporate a number of changes to statement processing that extend many of the performance benefits of stored procedures to all SQL statements. SQL Server 2000 and SQL Server 7.0 do not save a partially compiled plan for stored procedures when they are created. A stored procedure is compiled at execution time,like any other Transact-SQL statement. SQL Server 2000 and SQL Server 7.0 retain execution plans for all SQL statements in the procedure cache,not just stored procedure execution plans.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读