SQL DB Execute to a Role

Have you ever needed a less privileged user to execute Stored Procedures? Me too. Here is how you do it.

Run this against the database

— Create a db_executor role
CREATE ROLE db_executor

— Grant execute rights to the new role
GRANT EXECUTE TO db_executor

Then add the db_executor role to the users you want to be able to execute Stored Procedures.

Now you do need to be careful. You can be giving more rights than you want to do depending on what your procedures do but this still can be a good way to get that execute permission added.

-- Create a db_executor role
 CREATE ROLE db_executor

-- Grant execute rights to the new role
GRANT EXECUTE TO db_executor