Home >> FAQs/Tutorials >> SQL Server FAQ

SQL Server FAQs - Introduction to Cursors

By: FYIcenter.com

A collection of 9 FAQs on working with cursors. Clear explanations and tutorial exercises are provided on declaring cursor names and cursor variables; open and close cursors; looping through cursor result set; backward scrolling; dynamic cursors. Topics included in this collections:

  1. What Are Cursors?
  2. How To Declare a Cursor with "DECLARE ... CURSOR"?
  3. How To Execute the Cursor Queries with "OPEN" Statements?
  4. How To Fetch the Next Row from a Cursor with a "FETCH" Statement?
  5. How To Transfer Data from a Cursor to Variables with a "FETCH" Statement?
  6. How To Loop through the Result Set with @@FETCH_STATUS?
  7. How To Declare and Use Cursor Variables?
  8. How To Create a Scrollable Cursor with the SCROLL Option?
  9. How To Create a Dynamic Cursor with the DYNAMIC Option?

Please note that all answers and tutorials are based on SQL Server 2005 Express Edition. To follow tutorial exercises in this collection, you need to use test tables created from previous tutorial collections.

(Continued on next topic...)

Related Articles:


Other Tutorials/FAQs:


Related Resources:


Selected Jobs: