Conclusion
Throughout the book, I try to stress the advantages set-based solutions have over cursor-based ones. I show many examples of tuned set-based solutions that outperform the cursor alternatives. In this chapter, I explained why that’s the case for most types of problems. Nevertheless, I tried giving you the tools to identify the classes of problems that are exceptions–where currently SQL Server 2005 doesn’t provide a better solution than using cursors. Some of the problems would have better set-based answers if SQL Server implemented additional ANSI constructs, whereas others don’t even have proper answers in the ANSI standard yet. The point is that there’s a time and place for cursors if they are used wisely and if a set-based means of ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access