The descriptions of declare cursor and deallocate cursor in Table 28-1 refer to ad hoc cursors that are sent by isql or Client-Library. Other kinds of cursors allocate memory differently:
For cursors that are declared on stored procedures, only a small amount of memory is allocated at declare cursor time. Cursors declared on stored procedures are sent using Client-Library or the precompiler and are known as execute cursors.
For cursors declared within a stored procedure, memory is already available for the stored procedure, and the declare statement does not require additional memory.