Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: SQL-Server
Is it better to use cursors or looping througb Temp tables is a better choice?
Posted 13-Dec-12 10:58am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

It all depends on your situation, both options are not preferable in terms of performance.
 
Cursors are more preferable when you need to perform multiple operations one by one on each row of your physical table. So, only one row at a time would be in memory.
 
However, Temp Tables have your complete table data in memory, also you need to maintain additional variable for looping index purpose.
 
This is just a little comparison, Can you describe your situation in details ??
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

They both exist because both are useful at times. It depends on the situation. I would say that creating a temp table you can join against is often more efficient, but both are expensive options
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web03 | 2.8.140926.1 | Last Updated 13 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100