1.

Why You Should Not Use A Cursor? What Are Its Alternatives?

Answer»

If possible, avoid using SQL Server CURSORS. They generally use a LOT of SQL Server resources and REDUCE the performance and scalability of your applications. If you NEED to perform row-by-row operations, try to find another METHOD to perform the task. Here are some alternatives to using a cursor:

  • Use WHILE LOOPS
  • Use temp tables
  • Use derived tables
  • Use correlated sub-queries
  • Use the CASE statement
  • Perform multiple queries.

If possible, avoid using SQL Server cursors. They generally use a lot of SQL Server resources and reduce the performance and scalability of your applications. If you need to perform row-by-row operations, try to find another method to perform the task. Here are some alternatives to using a cursor:



Discussion

No Comment Found