Syntax to declare a cursor.

Posted by Abhisek under Sql Server category on | Views : 1534
DECLARE cursor_name CURSOR [SCROLL/DYNAMIC] FOR select_statement

SCROLL specifies that all fetch options are available. If SCROLL is not declared then NEXT is the only fetch option available.

DYNAMIC specifies a cursor that reflects all the data changes made to the rows in its result set as you scroll around the cursor.

Comments or Responses

Login to post response