Arguments [@cursor =] cursor_handle Is a cursor handle obtained by calling sp_cursorcreate. cursor_handle is int, with no default. [@optype =] optype Is a the operation to perform. optype is int, with no default and can be one of these values.
[@rownum =] rownum Is the number of the row to update in the fetch cache. rownum is int, with no default. [@table =] 'table' Is the name of the table to update (an empty character string seems to be ok). table is sysname, with no default. Return Code Values 0 (success) or 1 (failure).
Result Sets None.
Permissions Execute permissions default to the public role.
Example USE pubs
-- Create a dynamc cursor
DECLARE @cursor INT
EXEC sp_cursoropen @cursor OUTPUT, 'SELECT * FROM myTable', 2, 8193
-- Fetch the next 2 lines; this puts lines 1 and 2 in the fetch buffer