Skip to content

Instantly share code, notes, and snippets.

@jdaigle
Created May 24, 2012 13:09
Show Gist options
  • Save jdaigle/2781464 to your computer and use it in GitHub Desktop.
Save jdaigle/2781464 to your computer and use it in GitHub Desktop.
SQL Server Service Broker: Query to get estimated number of rows in queues
SELECT q.name, p.rows
FROM sys.partitions p
INNER JOIN sys.internal_tables t ON t.object_id = p.object_id
INNER JOIN sys.service_queues q ON q.object_id = t.parent_object_id
WHERE p.index_id IN (1, 0) --AND q.name = 'QueueName'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment