Inventory Open Cursors per Session with sys.dm_exec_cursors
Nov 3, 2026 / · 9 min read · sys.dm_exec_cursors sys.dm_exec_sessions sys.dm_exec_sql_text sys.dm_exec_requests sys.dm_exec_xml_handles sql server cursors dmv monitoring tsql tempdb ·If code declares a GLOBAL cursor and never deallocates it, the cursor stays allocated until the connection closes. While it stays open it can hold tempdb space, row locks or both. The collector query below snapshots every cursor on the instance with its properties, state, I/O and idle time, and a short follow-up query …
Read More