Sql-server – Query Notification setup

service-brokersql server

I am relatively new at playing around with this and have been trying to follow a tutorial on setting up in the section named "Prerequisites to Create SQL Notification Requests" within this site http://www.codeproject.com/Articles/144344/Query-Notification-using-SqlDependency-and-SqlCach However I am not sure what I should be putting in :://the service and there were no instructions or information on the site regarding this. I was wondering what I should do or what other information I need to complete this section.

Best Answer

The service specification is the name of the service used for query notifications. The tutorial is focused on SqlDependency, which creates dynamically-named services (GUID appended). No need to explicitly grant SEND permissions on the service in that case because the creator of the service will have CONTROL permissions on the service anyway.

If you were to use the lower-level SqlNotificationRequest object, then you would need to grant SEND on the service, REFERENCES on the contracts, and RECEIVE on the queues. That allows a less privileged account to subscribe to query notifications.