SQL Server(存储过程)临时表与滞后名称解析[4]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 hdaptechivan 的 blog

再説一次,新添加的列对于添加它的过程并非立即可见然而以上的代码却带来了一个性能问题,因爲任何创建临时表并近一步处理它的存储过程都将导致该过程的执行计划重新编译,这对于高吞吐量环境中的大型过程而言,性能会大打折扣以下过程将解决这个问题:

create proc test4

as

insert #temp default values

select c1 from #temp

go

 

create proc test3

as

create table #temp (k1 int identity,c1 varchar(2))

exec dbo.test4

go

 

create proc test2

as

create table #temp (k1 int identity,c1 int)

exec dbo.test4

go

 

create proc test @var int

as

本文关键:SQL Server(存储过程)临时表与滞后名称解析
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top