Chapter 7

Choosing and Managing Cursors

   

If your enterprise application needs to work with result set data (data returned to your application by a query statement), you probably use cursors. You can define a cursor as a query result set where browsing is enabled and the current position is known. With most cursors you can handle data access requirements like reading, inserting, updating, and deleting selected data.

When working with cursors, it is important that you understand how they operate and what they can do, so that you can decide on the best and most efficient cursor type for your application's data access requirements. To gain the full benefit from cursors, you must understand cursor types, their configuration options, and sometimes even consider an adjustment to the way your application uses data.

The following sections acquaint you with cursors and how to use them in your enterprise application.

Section Description
What Is a Cursor? Explains how a cursor lets an application use the result set.
Some Practical Cursor Tips Presents some useful cursor tips to optimize your enterprise application's data access requirements.
Choosing a Cursor Type Explains the different kinds of cursors and recommends the best cursor type for various kinds of applications.
Choosing a Cursor Library Explains the benefits and features of the differing cursor libraries.
Working With Cursors Discusses buffered result sets, server-side and client-side cursors, and cursor locks for handling shared data concurrency.

For More Information   For more information about cursors, search online for the "Cursors" topic in the Microsoft SQL Server Books Online. For more information on how cursors can affect your application's performance, and other recommendations for high-performance data access, see Data Access Performance Tuning.