Click here to Skip to main content
15,908,112 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Is it better to use cursors or looping througb Temp tables is a better choice?
Posted

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 ??
 
Share this answer
 
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
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900