我正在尝试BROKER_QUEUE_DISABLED
事件通知中的一个选项,它似乎没有正确生成代理队列禁用事件。有人可以验证我创建的脚本吗?(见下文)
脚本:
CREATE QUEUE NotifyQueue
GO
CREATE
SERVICE NotifyService
ON
QUEUE NotifyQueue
[http://schemas.microsoft.com/SQL/Notifications/PostEventNotification]);
GO
CREATE ROUTE NotifyRoute
WITH SERVICE_NAME = 'NotifyService',
ADDRESS = 'LOCAL';
GO
CREATE
EVENT NOTIFICATION [CHS_QueueDisabledNotif]
ON QUEUE [CHS_Change_Queue] WITH FAN_IN
FOR BROKER_QUEUE_DISABLED
TO SERVICE 'NotifyService', 'current database'
--Testing
--Try Disabling Application Queue
ALTER QUEUE dbo.CHS_Change_Queue WITH STATUS = OFF
SELECT * FROM NotifyQueue