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?