Quantcast
Channel: SQL Server Setup & Upgrade forum
Viewing all articles
Browse latest Browse all 3540

Send mail from SQL: permission denied

$
0
0

I have a trigger like this:

ALTER trigger [dbo].[TR_AlertOnConnection] on [dbo].[Log] with execute as owner for insert

In the trigger, the sp_send_dbmail is called to send an email. When a row is insterted in the table, I get an error:

The EXECUTE permission was denied on the object 'sp_send_dbmail', database 'msdb', schema 'dbo'.

I understand that I the user must be a member of DatabaseMailUserRole in order to send mail. But... since I execute the trigger "as owner", which user I have to put in this group?



Viewing all articles
Browse latest Browse all 3540

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>