9

I have an SQL Server 2012 instance running under a managed service account. I've configured database mail with one account and am trying to send a test email, but I'm getting some errors in the server's event logs:

Database Engine Instance=MYINSTANCE;Mail PID=2132;Error Message:The update to the database failed. Reason: The EXECUTE permission was denied on the object 'sysmail_logmailevent_sp', database 'msdb', schema 'dbo'.

Database Engine Instance=MYINSTANCE;Mail PID=2212; Exception Type: Microsoft.SqlServer.Management.SqlIMail.Server.Common.BaseException Message: The read on the database failed. Reason: The EXECUTE permission was denied on the object 'sp_readrequest', database 'msdb', schema 'dbo'. Data: System.Collections.ListDictionaryInternal TargetSite: Microsoft.SqlServer.Management.SqlIMail.Server.Objects.QueueItem GetQueueItemFromCommand(System.Data.SqlClient.SqlCommand) HelpLink: NULL Source: DatabaseMailEngine

If I make the account running the SQL Server process a sysadmin, this error goes away, and mails send successfully. However, all the research I've done suggests that giving this account the DatabaseMailUserRole role in the msdb database should be sufficient. I've done this and still receive the same errors.

I took a look in the BOL but couldn't find anything.

  • Is sql server and sql agent running under the same account ? – Kin Shah Feb 20 '14 at 20:12
  • @kin No, separate accounts (both managed service accounts). – Mansfield Feb 20 '14 at 20:18
  • can you try to run SQL Agent with the same service account as sql server - just to rule it out and check if that works ? – Kin Shah Feb 20 '14 at 20:32
  • @Kin That has sysadmin permission, so it will work. I've given my main service account sysadmin permission for now and everything is working - I'm just curious to know if that's too much. – Mansfield Feb 20 '14 at 20:47
4

SQL Server Agent service account requires sysadmin permissions on the instance.

Microsoft KB

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.