GRANT EXECUTE to all stored procedures

Chad picture Chad · Feb 17, 2012 · Viewed 271.4k times · Source

Does the following command effectively give the user, "MyUser," permission to execute ALL stored procedures in the database?

GRANT EXECUTE TO [MyDomain\MyUser]

Answer

Antony Scott picture Antony Scott · Feb 17, 2012

SQL Server 2008 and Above:

/* CREATE A NEW ROLE */
CREATE ROLE db_executor

/* GRANT EXECUTE TO THE ROLE */
GRANT EXECUTE TO db_executor

For just a user (not a role):

USE [DBName]
GO
GRANT EXECUTE TO [user]