SQL Flow Field Guide

sp_cursorexecute

Catalog support for SQL Server 2022 (16.x) and 2025 (17.x)

spcursorexecute creates and populates a cursor based upon the execution plan created by spcursorprepare.

What changes

Input
Not stated in the Microsoft summary.
Output or change
Not stated in the Microsoft summary.

Syntax at a glance

sp_cursorexecute prepared_handle , cursor
    [ , scrollopt [ OUTPUT ]
    [ , ccopt [ OUTPUT ]
    [ , rowcount OUTPUT [ , bound param ] [ , ...n ] ] ] ]
[ ; ]

Work example

spcursorexecute creates and populates a cursor based upon the execution plan created by spcursorprepare.

Read the parameter list and identify the provider operation it supports. Do not call it directly from application T-SQL.

Check your work Why does Microsoft limit direct calls to this procedure?

Open Microsoft Learn for full syntax, permissions, and details for your version.