Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Temp tables in calculations 1

Status
Not open for further replies.

manmaria

Technical User
Aug 8, 2003
286
US
What are the drawbacks for using the temp tables in calculation in stored procedures? Are they going to be a performance issue?

Thanks
 
Hi Manmaria,

Personally I find that the spec of the server hosting your database has a very strong influence but the overall consensus seems to be to try to avoid using temporary tables where possible:

either by using derived table:

or by using the table variable when appropriate(i.e. smaller data sets):

SQL Server Temp Table Performance Tuning Tips

In my experience when working with very large data sets, using a physical table offers more performance (even though in theory a temp table is a physical table :)).

Hope this helps.

cheers,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top