September 25, 2011 at 8:26 pm
Hello,
we have a database "user1" in one of the user database(dbadver) and "user1" needs to use "msdb.sp_send_dbmail" for their application, but I am not sure how to assign user1 to execute this system stored procedure (sp_send_dbmail). Can some body please let me know the steps how to assign such privilege.
Thanks
Aj
September 25, 2011 at 8:31 pm
in the msdb database, you'll need to add the user, adn then make him a member of the [DatabaseMailUserRole] role.
USE [msdb]
GO
CREATE USER [user1] for login [user1]
EXEC sp_addrolemember 'DatabaseMailUserRole','user1'
Lowell
September 25, 2011 at 9:53 pm
I hate giving users any privs. We've got it pretty much locked down at work so that users have no privs other than PUBLIC and "execute". All of our stored procedures are owned by "SA". If you simply add the command to "execute as owner" and grant the user the privs to execute the proc (actually, all of our users are members of the database role we call "Executor" which is allowed to run all stored procedures in the DB), they can send mail by using the proc without elevating their privs nor can they send mail without using the proc.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply