Cursor 执行exec中的数据


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58
 DECLARE @show_num  varchar(9);
 Declare @abc nvarchar(200)
set @abc = 'select count(*)  from visitcustomer';
exec ('declare mycur cursor for ' + @abc)

open mycur;
fetch next from mycur into @show_num;
close mycur; 
DEALLOCATE mycur
select @show_num;