I'm using Service Broker to [maybe] monitor my database events, so I have my activation sp in some user database and it should react on some events by sending e-mail to admin. But it fails with the error
The EXECUTE permission was denied on the object 'sp_send_dbmail', database 'msdb', schema 'dbo
while trying to use sp_send_dbmail.
How can I manage the permissions in my case?
guestifTRUSTWORTHYisOFF(highly recommended). The only way to keep that setting off and not need to grant permissions toguestis to use SQLCLR as I demonstrate in the linked duplicate. FWIW, this is the 2nd trickiest use case I've found in my efforts to avoid Impersonation andTRUSTWORTHY;-). – Solomon Rutzky Sep 14 '17 at 14:03TRUSTWORTHY ON. I was able to get it working in pure T-SQL via module signing once I learned about the minor yet critical option I was missing from my original attempt at this. I have updated my answer to that linked, duplicate question with the explanation and the fully working example code. – Solomon Rutzky Sep 25 '17 at 20:51