| cynical86 2005-08-02, 12:24 pm |
| Hello All,
Thanks for reading my question.
I am trying to find out how many open cursors exist at a particular time on a SQL Server instance. I was able to google this for Oracle, but no luck with SQL Server.
There are tables in master that seem likely (dbo.syscursor*), but I never find any rows in them, even when I am definitely holding a cursor open (code below, in case I am missing something).
Does anyone have any suggestions on this? Thanks so much for your time.
Eric
---------------------------------------
declare @docnum int
declare longtime cursor for
select transactionnum
from somelargelogtable
where (transactionnum /2) > 100
open longtime
fetch next from longtime into @docnum
while (@@fetch_status = 0)
begin
print @docnum
waitfor delay '00:05'
fetch next from longtime into @docnum
end
close longtime
deallocate longtime
--------------------------------------- |