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;
上一篇: 执行链接服务器上的存储过程
下一篇: 系统数据库