SQL Server/T-SQL Tutorial/Cursor/FETCH STATUS
While (@@FETCH_STATUS = 0)
4> USE master
5> GO
Changed database context to "master".
1>
2> CREATE PROC sp_cursor_info
3> (@scope int = 3)
4> AS
5> DECLARE @Report CURSOR
6> EXEC master.dbo.sp_cursor_list @cursor_return = @Report OUTPUT,
7>
8> @cursor_scope = @scope
9> FETCH NEXT FROM @Report
10> WHILE (@@FETCH_STATUS = 0)
11> BEGIN
12> FETCH NEXT FROM @Report
13> END
14> CLOSE @Report
15> DEALLOCATE @Report
16> RETURN
17> GO
1>
2>