Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Cursors (Transact-SQL)

Cursors (Transact-SQL)


Applies To: SQL Server 2014, SQL Server 2016 Preview

Microsoft SQL Server statements produce a complete result set, but there are times when the results are best processed one row at a time. Opening a cursor on a result set allows processing the result set one row at a time. You can assign a cursor to a variable or parameter with a cursor data type.

Cursor operations are supported on these statements:


         CREATE PROCEDURE       


         DECLARE CURSOR       

         DECLARE @local_variable       






These system functions and system stored procedures also support cursors:








Community Additions

© 2015 Microsoft