USE [CatalogWithMessageBroker]
GO
select q.name as QueueName, p.rows as MsgCount, case sq.is_receive_enabled when 0 then 'Disabled' else 'Enabled' end as QueueEnabled
from sys.objects as o
join sys.partitions as p on p.object_id = o.object_id
join sys.objects as q on o.parent_object_id = q.object_id
join sys.service_queues sq on sq.name = q.name
where p.index_id = 1