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.
| Author |
Topic |
|
blakmk
Starting Member
45 Posts |
Posted - 2003-04-16 : 05:05:14
|
| Does anyone know a way of finding out how many cursors are open on a particular database? |
|
|
macka
Posting Yak Master
162 Posts |
Posted - 2003-04-16 : 06:01:09
|
| blakmk,SELECT COUNT(*) AS open_cursorsFROM master..syscursortables ctINNER JOIN master..syscursors c ON ct.cursor_handle = c.cursor_handleWHERE dbname='Northwind'Cheers,macka.--There are only 10 types of people in the world - Those who understand binary, and those who don't. |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2003-04-16 : 08:56:01
|
| I would think the answer should be: ZERO!Don't forget to CLOSE and DEALLOCATEOn second thought, avoid CURSORS like the plague.The only time you should have to use a CURSOR is when you need to pass parameters to a commandSee Tara's response in this thread:http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=25405PS Why do you need to know what's Open out there?Brett8-) |
 |
|
|
|
|
|