我收到此错误:未能执行msdb.dbo.sp_send_dbmail
Msg 229, Level 14, State 5, Procedure sp_send_dbmail, Line 1
The EXECUTE permission was denied on the object 'sp_send_dbmail', database 'msdb', schema 'dbo'.
代码的相关部分:
/****** Object: StoredProcedure [dbo].[dbo.STATUSCHANGE_EMAILALERT] ******/
EXEC msdb.dbo.sp_send_dbmail
@recipients = '[email protected]', -- Group Email
@subject = 'Employee Status Update',
@profile_name ='[email protected]', -- Setup the profile name group
@body = @body,
@body_format = 'HTML';
错误提示您无法访问'sp_send_dbmail'存储过程。您需要将获准'EXECUTE'它 – Taryn
我发现这一点:http://stackoverflow.com/questions/5569511/how-to-give-access-to-sql-server-database-mail-procedures-for-一个登录-IN-A-迪菲 –
我觉得有一点点不仅仅是单独的权限包括,将张贴在这里一次,我知道得更多。感谢评论蓝。你有没有注意到我的脚本中有什么可以改进的地方? –