我收到此錯誤:未能執行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-迪菲 –
我覺得有一點點不僅僅是單獨的權限包括,將張貼在這裏一次,我知道得更多。感謝評論藍。你有沒有注意到我的腳本中有什麼可以改進的地方? –