Created
January 17, 2017 20:45
-
-
Save gertd/5ab6e1ff8eca1604e5c3d43ed075a3d1 to your computer and use it in GitHub Desktop.
SQL Server Service Broker Queue Depth (number of rows enqueued)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create function dbo.GetQueueCount() | |
returns table | |
as | |
return | |
select q.name, | |
p.rows | |
from sys.objects as o | |
inner join sys.partitions as p | |
on p.object_id = o.object_id | |
inner join sys.objects as q | |
on o.parent_object_id = q.object_id | |
where p.index_id = 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment