July 23, 2015 at 9:34 am
On a test instance of sql, I have a sql server login UserX that is a member of the DatabaseMailUserRole.
In DatabaseA, there is a stored procedure that uses the Execute as 'UserX' clause which executes the msdb.dbo.sp_send_dbmail. It sends mail just fine.
In DatabaseB on the same instance, the same exact code is used with the same user. Email failure: The EXECUTE permission was denied on the object 'sp_send_dbmail'
I'm stumped right now. Any ideas?
July 23, 2015 at 2:53 pm
Is userx a user in both databases? Just wondering!
July 24, 2015 at 6:40 am
User is in both databases.
July 24, 2015 at 8:30 am
July 27, 2015 at 11:46 am
Thank you for the response, but no. The user logged in is Userx. The stored procedure executes as UserX. Not exactly the same situation
I can create this scenario, when I log in as myself and use execute as.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply