Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 finding open Cursors ?

Author  Topic 

khufiamalik
Posting Yak Master

120 Posts

Posted - 2008-10-16 : 07:08:27
how to find that how many Cursors are still open?????

Transact Charlie
Master Smack Fu Yak Hacker

3451 Posts

Posted - 2008-10-16 : 07:29:47
This should get you started

DECLARE @report CURSOR

EXEC sp_cursor_list @report OUTPUT, @cursor_scope = 3

FETCH NEXT from @Report
WHILE (@@FETCH_STATUS <> -1)
BEGIN
FETCH NEXT from @Report
END
CLOSE @Report
DEALLOCATE @Report


-------------
Charlie
Go to Top of Page
   

- Advertisement -