The EXECUTE permission was denied on the object 'sp_send_dbmai

  • A support analyst need to be able to send email via the sp_send_dbmail command. When he attempts to run a script using his existing permissions he receives this message:

    Do not have execute rights on msdb d/b to run below SQL script, with message ‘The EXECUTE permission was denied on the object 'sp_send_dbmail', database 'msdb', schema 'dbo'.’

    I have added him to the DatabaseMailUserRole but he still receives the error. I have also given him execute permissions on the msdb database, but this hasn’t worked either.

    Giving him full sysadmin rights allows him to execute this procedure without any problems, but for obvious reasons I don’t want him to have sysadmin rights.

  • jabba (9/10/2009)


    A support analyst need to be able to send email via the sp_send_dbmail command. When he attempts to run a script using his existing permissions he receives this message:

    Do not have execute rights on msdb d/b to run below SQL script, with message ‘The EXECUTE permission was denied on the object 'sp_send_dbmail', database 'msdb', schema 'dbo'.’

    I have added him to the DatabaseMailUserRole but he still receives the error. I have also given him execute permissions on the msdb database, but this hasn’t worked either.

    Giving him full sysadmin rights allows him to execute this procedure without any problems, but for obvious reasons I don’t want him to have sysadmin rights.

    Execute permissions for sp_send_dbmail default to all members of the DatabaseMailUser database role in the msdb database. However, when the user sending the message does not have permission to use the profile for the request, sp_send_dbmail returns an error and does not send the message.

    if you impersonate his account, do you get the execute permission denied error. I would try granting the execute permissions explictly to his login.

    --------------------------------------------------------------------------------------
    [highlight]Recommended Articles on How to help us help you and[/highlight]
    [highlight]solve commonly asked questions[/highlight]

    Forum Etiquette: How to post data/code on a forum to get the best help by Jeff Moden[/url]
    Managing Transaction Logs by Gail Shaw[/url]
    How to post Performance problems by Gail Shaw[/url]
    Help, my database is corrupt. Now what? by Gail Shaw[/url]

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply