数据库 – 存储过程的缺点

想获得使用存储过程的优缺点列表。 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.

相关文章

SELECT a.*,b.dp_name,c.pa_name,fm_name=(CASE WHEN a.fm_n...
if not exists(select name from syscolumns where name=&am...
select a.*,pano=a.pa_no,b.pa_name,f.dp_name,e.fw_state_n...
要在 SQL Server 2019 中设置定时自动重启,可以使用 Window...
您收到的错误消息表明数据库 'EastRiver' 的...
首先我需要查询出需要使用SQL Server Profiler跟踪的数据库标...