SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Old Forums
 CLOSED - General SQL Server
 Temp table / Table variable
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

jung1975
Aged Yak Warrior

USA
503 Posts

Posted - 03/30/2005 :  16:39:03  Show Profile
Is there any performance difference between using a Temp table and using a Table variable?





nr
SQLTeam MVY

United Kingdom
12543 Posts

Posted - 03/30/2005 :  18:12:33  Show Profile  Visit nr's Homepage
Yes.
A variable takes less resources to create but gives less optimisation options less indexing possibilities and you also can't detect it's existence or size from another spid.
So table variables are usually used for small tables and temp tables for large ones.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000