返回的游标
sp_cursor_list 返回的报告是 Transact-SQL 游标输出参数,而不是结果集。这样,Transact-SQL 批处理、存储过程和触发器就得以按一次一行的方式处理输出。这还意味着无法直接从数据库 API 函数调用该过程。游标输出参数必须绑定到程序变量,但是数据库 API 不支持绑定游标参数或变量。
exec sp_cursor_list @a output,2
open @a
fetch next from @a into @cname ..游标的其他值
while @@fetch_status=0
begin
print @cname
fetch next from @a into @cname ..游标的其他值