Ways to avoid using cursors

          

Interview questions

SQL Server - ways to avoid using cursors

Next>>         SQL Server tutorial  

SQL Server - ways to avoid using cursors - Feb 27, 2010 at 11:50 AM by Shuchi Gauri

What are ways that can be used to avoid using cursors in my applications?

Ways to avoid cursors:

  • Write SQL Statements instead of cursors if action applied to rows is same.
  • Rewrite cursors as a derived query.
  • Use temporary tables instead of cursors
  • Cursors have poor performance, thus, rewrite them as complex SQL Statements.

SQL Server - ways to avoid using cursors - May 05, 2009 at 22:00 PM by Rajmeet Ghai

What are ways that can be used to avoid using cursors in my applications?

  • The cursor can be written as a normal query in case of scenarios when the task needs to be performed repeatedly.
  • The cursor can be re written as a derived query.
  • The cursor can be re written as using temporary or table variables in a query.

SQL Server - ways to avoid using cursors - June 21, 2009 at 09:00 AM by Amit Satpute

  • Rewrite the cursor as a normal query. A standard query wouldn’t waste server resources.
  • The cursor can be rewritten as a derived query.
  • The cursor should be rewritten using temporary tables in a query.
  • The cursor should be rewritten using table variables in a query.

Next>>

Also read

What are the capabilities of Cursors?

Answer - Cursors can support various functionalities that are listed here.....

What are the ways to controlling Cursor Behavior?

Answer - Cursors behavior can be controlled by dividing them into cursor types: forward-only, static,........

What are the advantages of using Stored Procedures?

Answer - Stored procedures provide performance benefits through local storage, precompiling the code, and caching...... 



Write your comment - Share Knowledge and Experience


 

 
Latest placement tests
Latest links
 
Latest MCQs
» General awareness - Banking » ASP.NET » PL/SQL » Mechanical Engineering
» IAS Prelims GS » Java » Programming Language » Electrical Engineering
» English » C++ » Software Engineering » Electronic Engineering
» Quantitative Aptitude » Oracle » English » Finance
Home | About us | Sitemap | Contact us | We are hiring