Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Execute permission was denied on the object SP_SEND_DBMAIL


Execute permission was denied on the object SP_SEND_DBMAIL

Author
Message
eyespi20
eyespi20
SSC Rookie
SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)

Group: General Forum Members
Points: 35 Visits: 226
We moved our production databases from an SQL2008R2 Standard Edition to SQL2012 Enterprise edition this past weekend. I have a DBMailUserRole defined in MSDB that has the execute rights to the sp_send_dbmail stored procedure and the user that is attempting to execute the sp is a member of the role, but I'm still getting this error.

Anyone have any idea what I need to do in order to get this working?

Thanks!
jvkondapalli
jvkondapalli
Valued Member
Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)

Group: General Forum Members
Points: 59 Visits: 684
Firstly, Can you check if dbmail is enable in sys.configurations.

BOL: "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."

eyespi20 (2/18/2013)
We moved our production databases from an SQL2008R2 Standard Edition to SQL2012 Enterprise edition this past weekend. I have a DBMailUserRole defined in MSDB that has the execute rights to the sp_send_dbmail stored procedure and the user that is attempting to execute the sp is a member of the role, but I'm still getting this error.

Anyone have any idea what I need to do in order to get this working?

Thanks!


Thanks
Jagan K
eyespi20
eyespi20
SSC Rookie
SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)

Group: General Forum Members
Points: 35 Visits: 226
Yes, the role does have permission to execute the stored procedure sp_send_DBMAIL and the user is a member of the role. DBMail is enabled and a default profile is defined and test messages go through.
SQLQuest29
SQLQuest29
Right there with Babe
Right there with Babe (748 reputation)Right there with Babe (748 reputation)Right there with Babe (748 reputation)Right there with Babe (748 reputation)Right there with Babe (748 reputation)Right there with Babe (748 reputation)Right there with Babe (748 reputation)Right there with Babe (748 reputation)

Group: General Forum Members
Points: 748 Visits: 4314
eyespi20 (2/18/2013)
We moved our production databases from an SQL2008R2 Standard Edition to SQL2012 Enterprise edition this past weekend. I have a DBMailUserRole defined in MSDB that has the execute rights to the sp_send_dbmail stored procedure and the user that is attempting to execute the sp is a member of the role, but I'm still getting this error.

Anyone have any idea what I need to do in order to get this working?

Thanks!


Does the user have a default profile associated ?

Can you post output of below queries and verify if the environment is clustered or not ?

SELECT * FROM msdb.dbo.sysmail_sentitems order by sent_date desc

SELECT * FROM msdb.dbo.sysmail_allitems order by sent_date desc

SELECT * FROM msdb.dbo.sysmail_event_log order by log_date desc
SELECT * FROM msdb.dbo.sysmail_unsentitems
select * from msdb.dbo.sysmail_configuration



______________________________________________________________________________________________________________________________________________________________________________________
HTH !
Kin
MCTS : 2005, 2008
Active SQL Server Community Contributor :-)
jvkondapalli
jvkondapalli
Valued Member
Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)

Group: General Forum Members
Points: 59 Visits: 684
Did you also hook up the mail profile in sqlagent's Alert system tab. I don't think this will have any impact on using dbmail through a procedure. But, worth a try

Thanks
Jagan K
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search