Click here to Skip to main content
13,089,400 members (59,446 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Is it better to use cursors or looping througb Temp tables is a better choice?
Posted 13-Dec-12 10:58am
Rate this: bad
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 ??
Rate this: bad
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

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.170813.1 | Last Updated 13 Dec 2012
Copyright © CodeProject, 1999-2017
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