CLOSE
closes a cursor
What changes
- Input
- open cursor
- Output or change
- cursor state (closed, result released)
Syntax at a glance
CLOSE { { [ GLOBAL ] cursor_name } | cursor_variable_name }
Work example
Cursor row processing is complete but the cursor declaration remains allocated.
Close the cursor on success and error paths. Keep DEALLOCATE separate so the lifecycle stays visible.
Check your work CLOSE. The cursor is closed before its declaration is released or reused.
Open Microsoft Learn for full syntax, permissions, and details for your version.