May 23, 2004 at 11:29 pm
As far as i read on the net using temp table increase the execution time of the procedure, but my collegue says that he decreased it after he rewrote the procedure using temp tables, which I wrote using derived tables.
May 24, 2004 at 3:49 am
There is no hard and fast rule. Good coding is usually far more important than the chosen execution method.
If you're not sure, then try both!
May 24, 2004 at 10:41 pm
You were right robert, we have improved the performance by optimizing the query and using the temp tables. but, can we improve it furthur if we use "Table" variable instead of using temp tables?
May 25, 2004 at 4:41 am
I can't say for sure since I haven't played with table variables very much, but I'd suspect that they're basically a convenience and that the underlying implementation will not differ much from standard temp tables.
Best suggestion is to try it and see.
May 25, 2004 at 8:49 am
Table variables and temp tables are different in their implementation. You can read all about it at:
http://support.microsoft.com/default.aspx?scid=kb;en-us;305977
May 25, 2004 at 9:36 am
In some instances adding an index or a clustered index to the #Temp table can greatly enhance perfomance. This is one thing that that #Temp tables have over the other methods, and when appropriately used can have impact.
Robert is correct in writing "There are no hard & fast rules..."
Once you understand the BITs, all the pieces come together
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply