SQL SERVER – List Service Broker Queue Count

I have not used a service broker for quite a while and I have almost forgotten how it works. However, when paying clients of  Comprehensive Database Performance Health Check ask me questions, I try my best to help if I know the answer. Recently I was asked if I know how to List Service Broker Queue Count.

Solar panel field with the title Service Broker Queue Count

Yes it is possible to list service broker quite count and there is a very simple script for it.

SELECT ob.Name, p.Rows
FROM sys.objects o
INNER JOIN sys.partitions p ON p.object_id = o.object_id
INNER JOIN sys.objects ob ON o.parent_object_id = ob.object_id
WHERE p.index_id = 1
GO

When you run the script above it will return the result which is very simple to the following the image where it will list the name of the queue with the queue count.

Well, that’s it for today a simple old-style blog which I used too many years ago, and I am still finding the joy in it.

SQL query to view service broker queues.

Let me know if you are interested to know more about this topic. I will write more blogs as well as create an SQL in Sixty Seconds video.

Here are my few recent videos and I would like to know what is your feedback about them.

Published by Pinal Dave on SQLAuthority. More of my work at pinaldave.com.

Service Broker, SQL Scripts, SQL Server
Previous Post
SQL SERVER – Enable or Disable All Triggers
Next Post
Apache2 Linux – Common Commands

Related Posts

1 Comment. Leave new

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.