View Single Post
  #3 (permalink)  
Old November 22nd, 2006, 08:30 AM
Jeff Moden Jeff Moden is offline
Friend of Wrox
Points: 1,536, Level: 15
Points: 1,536, Level: 15 Points: 1,536, Level: 15 Points: 1,536, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Oct 2006
Location: , MI, USA.
Posts: 475
Thanks: 0
Thanked 9 Times in 9 Posts

Why don't you just try it?

I don't know because I don't ever use the TABLE datatype for this type of thing because they aren't capable of using STATISTICS and cannot be made to do so. Since both TEMP tables and TABLE variables start out in memory and they both spill over into TEMPDB when they get big, there's no performance advantage there, either. In fact, the only thing I ever use table variables for is if I need a temporary data structure in a function... and if they allowed TEMP tables there, I wouldn't use TABLE variables at all.

Most folks consider that just because TABLE variables live only at the procedure level that there's some sort of advantage to them disappearing on their own. Have you ever tried to troubleshoot the contents of something that disappears at run completion?

Just in case anyone thinks I'm full of hooey on this, please study Q3/A3 and Q4/A4 of the following URL...

--Jeff Moden
Reply With Quote