sys.sp_cursorfetch

general
#stored-procedure

Description

Fetches a buffer of one or more rows from the database. The group of rows in this buffer is value generated by SQL Server and returned by input value. For more information, see the Specifies which cursor buffer to fetch. is an optional parameter that requires one of the following integer input values.

Syntax

sp_cursorfetch cursor
[ , fetchtype [ , rownum [ , nrows ] ] ]
[ ; ]

Arguments

operation sets the position of the cursor to the first row in the new fetch

buffer while other cursor calls don’t affect the value of the position.

linked by an

clause with

in order to set the value of

the position to the last modified row.

If a row in the fetch buffer isn’t specified through the

parameter, the position is set to

1, with no error returned. Once the position is set, it remains in effect until the next

operation, T-SQL

operation, or

operation is

performed on the same cursor.

can be linked by an

clause with

cursor position to the last modified row.

If specified, the

parameter can be interpreted as the row number within the keyset

instead of the row number within the fetch buffer. The user is responsible for ensuring that

concurrency control is maintained. This means that for

cursors, you must

independently maintain a lock on the given row (which can be done through a transaction). For

cursors, you must have previously fetched the row to perform this operation.

and a full update or insert statement is submitted as

parameter, the value specified for

is ignored.

There are two alternatives to the rules for using

as stated earlier in the Arguments

  1. You can use a name that is

prepended to the name of the column in the select-list for

parameters. One advantage of this alternative is that data conversion

Pertaining to views, only one table participating in the view might be modified. The

parameter column names must reflect the column names in the view, but the table name

can be that of the underlying base table (in which case

substitutes the view

sp_cursorfetch (Transact-SQL)

System stored procedures (Transact-SQL)