Built-in database role in SQL Server 2005 to permit execution of stored procedures?

frankadelic picture frankadelic · Feb 19, 2010 · Viewed 15.6k times · Source

In SQL Server 2005, there are built in roles:

db_datareader

db_datawriter

etc.

Is there any role that lets a user execute an stored proc?

I don't want to use db_owner, because that will permit deletion and updates, which I don't need. The only permissions I need are:

SELECT

EXECUTE

Answer

Aaron picture Aaron · Feb 19, 2010

Take a look at this article. It may provide you an interesting idea to do this quickly.

Code used in that article:

/* Create a new role for executing stored procedures */
CREATE ROLE db_executor

/* Grant stored procedure execute rights to the role */
GRANT EXECUTE TO db_executor

/* Add a user to the db_executor role */
EXEC sp_addrolemember 'db_executor', 'AccountName'