Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Is sp_executesp fast in temp table?

Author  Topic 

Sun Foster
Aged Yak Warrior

515 Posts

Posted - 2010-04-09 : 14:29:09
My old code used temp table in which there are about 50 columns.

create table #a(...50 columns)
insert into #a
select (...50 columns) from order where ID =@id

If I re-code to use sp_executesp, is it fast?

Sun Foster
Aged Yak Warrior

515 Posts

Posted - 2010-04-09 : 14:46:27
Sorry, I mean sp_executesql not sp_executesp
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-04-09 : 15:13:08
no. it's not going to make it any faster
Go to Top of Page

dineshrajan_it
Posting Yak Master

217 Posts

Posted - 2010-04-10 : 00:59:45
sp_executesql is faster since it doesnt get recomplied based on specify various input parameters for query. And also make sure u keep the option plan for temp table for cahcing

Iam a slow walker but i never walk back
Go to Top of Page
   

- Advertisement -