我有一个这样的触发器:
ALTER trigger [dbo].[TR_AlertOnConnection]
on [dbo].[Log]
with execute as owner
for insert
在触发器中,调用sp_send_dbmail发送电子邮件。当一行插入表中时,我收到一个错误:
The EXECUTE permission was denied on the object 'sp_send_dbmail', database 'msdb', schema 'dbo'.
据我所知,用户必须是DatabaseMailUserRole的成员才能发送邮件。但是......因为我执行了“作为所有者”的触发器,我必须将哪个用户放在这个组中?