我收到此错误:
消息229,级别14,状态5,过程sp_send_dbmail,行1
对象'sp_send_dbmail',数据库'msdb',架构'dbo'上的EXECUTE权限被拒绝.
代码的相关部分:
/****** Object: StoredProcedure [dbo].[dbo.STATUSCHANGE_EMAILALERT] ******/
EXEC msdb.dbo.sp_send_dbmail
@recipients = 'Test@gmail.com', -- Group Email
@subject = 'Employee Status Update',
@profile_name ='Test@gmail.com', -- Setup the profile name group
@body = @body,
@body_format = 'HTML';
Run Code Online (Sandbox Code Playgroud)