# Database Discussions > MS SQL Server 7/MS SQL Server 2000 >  Testing for an empty Cursor

## ryand09

I've got Initial and Secondary Approver categories. I need to open a cursor to test for the Secondary Approver, if the Cursor is empty I need to pick up the Initial approver. I'm not sure how to test for an empty cursor

--Cursor for the Approvwers 
Declare Approve_curs cursor 
FOR SELECT a.P_ID, a.Last +', '+ a.First
FROM tblApprovers a
where ((a.AppRole)='S')
FOR READ ONLY
--Open Cursor
OPEN client_curs
FETCH NEXT FROM Approve_curs INTO @P_ID, @text
'I need to test here for an empty Cursor ???
--Start Loop 
WHILE @@fetch_status = 0 
BEGIN ....

Thanks in Advance ...

----------


## skhanal

Can't you use SELECT @cnt = COUNT(*) FROM <---cursor select clause --->

if @cnt = 0 then ..

----------


## Rawhide

@@Fetch_Status will be = -1 if the cursor is empty (beyond the end of the cursor) after initially calling the Fetch Next.

----------

