--Create a queue to receive messages.CREATE QUEUE pmNotifyQueue ;GO--Create a service on the queue that references--the event notifications contract.CREATE SERVICE pmNotifyServiceON QUEUE pmNotifyQueue([http://schemas.microsoft.com/SQL/Notifications/PostEventNotification],);GO--Create the event notification.CREATE EVENT NOTIFICATION pmQueueDisabled ON DATABASE FOR BROKER_QUEUE_DISABLED TO SERVICE 'pmNotifyService', 'current database';
CREATE EVENT NOTIFICATION pmQueueDisabled ON QUEUE pmNotifyQueue FOR BROKER_QUEUE_DISABLED TO SERVICE 'pmNotifyService', 'current database';