So i am following the example here: http://www.sqlservercentral.com/articles/Event+Notifications/68831/
When i get to this point there isn't anything returned from ErrorLogNotificationsQueue. This is just the beginning of the problem because i really want deadlock and blocked process reports collected but i can't get this to work yet.
-- Test the Event Notification by raising an ErrorRAISERROR (N'Test ERRORLOG Event Notifications', 10, 1) WITH LOG;
GO
SELECT *
FROM ErrorLogNotificationQueue
GO
Full SQL follows.
USE Master; DROP EVENT NOTIFICATION CaptureErrorLogEvents ON SERVER GO DROP DATABASE system_notifications; GO CREATE DATABASE system_notifications; GO ALTER DATABASE system_notifications SET ENABLE_BROKER ; GO USE system_notifications; GO CREATE QUEUE ErrorLogNotificationQueue; GO CREATE SERVICE ErrorLogNotificationService ON QUEUE ErrorLogNotificationQueue ([http://schemas.microsoft.com/SQL/Notifications/PostEventNotification]) GO CREATE EVENT NOTIFICATION CaptureErrorLogEvents ON SERVER WITH FAN_IN FOR ERRORLOG TO SERVICE 'ErrorLogNotificationService', 'current database'; GO -- Query the catalog to see the queue SELECT * FROM sys.service_queues WHERE name = 'ErrorLogNotificationQueue'; GO -- Query the catalog to see the service SELECT * FROM sys.services WHERE name = 'ErrorLogNotificationService'; GO -- Query the catalog to see the notification SELECT * FROM sys.server_event_notifications WHERE name = 'CaptureErrorLogEvents'; GO -- Test the Event Notification by raising an Error RAISERROR (N'Test ERRORLOG Event Notifications', 10, 1) WITH LOG; GO SELECT * FROM ErrorLogNotificationQueue GO
-- dan http://dnhlmssql.blogspot.com/