• Your understanding is correct, because the dynamic sql will be executing in a differenc scope to your main procedure you will have to include the WHOLE cursor operation (declare, open, fetch, close, deallocate) within your dynamic code.