sqlserver 存储过程中写一个游标,怎么获取游标当前执行的行数?
@@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.
如果我不知道也懒得去学游标的某些属性, 我就会傻傻地在开始定义一个int变量, 每次count++;