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 ...

Get Inside Microsoft® SQL Server™ 2005 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.