DEALLOCATE
deallocates a cursor
What changes
- Input
- cursor reference
- Output or change
- cursor removed
Syntax at a glance
DEALLOCATE { { [ GLOBAL ] cursor_name } | @cursor_variable_name }
Work example
A cursor is no longer needed and its reference should be released.
Deallocate it after CLOSE. Review every early return and catch path for a matching cleanup step.
Check your work DEALLOCATE. No live cursor reference remains after the routine finishes.
Open Microsoft Learn for full syntax, permissions, and details for your version.