首页 新闻 搜索 专区 学院

sqlserver 存储过程中写一个游标,怎么获取游标当前执行的行数?

0
悬赏园豆:20 [已解决问题] 解决于 2015-04-10 23:56

sqlserver 存储过程中写一个游标,怎么获取游标当前执行的行数?

浮生丶若梦灬的主页 浮生丶若梦灬 | 初学一级 | 园豆:3
提问于:2015-04-07 15:37
< >
分享
最佳答案
0

@@CURSOR_ROWS

Returns the number of qualifying rows currently in the last cursor opened on the connection. To improve performance, SQL Server can populate large keyset and static cursors asynchronously. @@CURSOR_ROWS can be called to determine that the number of the rows that qualify for a cursor are retrieved at the time @@CURSOR_ROWS is called.

https://msdn.microsoft.com/en-us/library/ms176044.aspx

收获园豆:20
爱编程的大叔 | 高人七级 |园豆:30753 | 2015-04-07 15:49
其他回答(1)
0

如果我不知道也懒得去学游标的某些属性, 我就会傻傻地在开始定义一个int变量, 每次count++; 

奋奋奋 | 园豆:32 (初学一级) | 2015-04-07 15:46
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册