在sql存储过程时, 有时可能需要处理动态语句返回的游标值。例子如下: set @str_sql = 'declare cur1 cursor for select distinct startdate from ' + @str_tablename; execute (@str_sql); open cur1; fetch next from cur1 into @i_startdate; while (@@fetch_status = 0) begin --针对游标返回的每一个值进行处理 fetch next from cur1 into @i_startdate; end close cur1; deallocate cur1;