Is there an elegant way for sending e-mails using a Service Broker service/queue?
I want to setup an EVENT NOTIFICATION
for SQL Server, and I'd like to send e-mails to operators for each message on the queue.
According to the book SQL Server 2005 DBA Street Smarts: A Real World Guide to SQL Server 2005 Certification Skills
, Database Mail uses the Service Broker:
Additionaly, Database Mail is scalable because it uses the Service Broker queue, which allows the requests to be handled asynchronously and even saves the request if the server goes down before it can be handled.
Maybe I'm too off base here, but, is there a way I can send messages directly to the Database Mail queue using Service Broker?
If I have to set up a stored procedure for sending an e-mail on behalf of Service Broker, I think it should be easier to just setup a job on the SQL Server Agent to check for the events I'm interested in inside the error log and send the operators an e-mail.
I'm open to suggestions.