• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 9. Transact-SQL > Programming a Cursor

Programming a Cursor

The commands you have learned so far for programming stored procedures allow you to query resultsets and to use control structures, where necessary, to control the program flow using the procedure. You still need to learn how to view resultsets in the stored procedure record by record. You can do so using a cursor. If you are familiar with the DAO or ADO programming interfaces, then you will recognize similarities in recordsets and loops such as DO WHILE NOT rs.EOF ... LOOP.

Chapter 8, “Stored Procedures,” in the section entitled “Loops,” describes the procedure AllFilms, with which you can generate a list of all film titles, separated by semicolons. This example is used here in conjunction with a cursor:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint