Tag Archives: Execute

How to grant the execute permission to User on all the procedure of the database?

SQL Server 2005 onward, we can create the roles in database. You can follow below simple script to grant the EXECUTE permission to user.

 

-- creating the database role 
CREATE ROLE Database_Executor
-- granting the execute permission to database role
GRANT EXECUTE TO Database_Executor

-- Here I am granting the SQLDBPool login execute permission
USE [DBName]
GO
CREATE USER [SQLDBPool] FOR LOGIN [sqldbpool]
GO
USE [DBName]
GO
EXEC sp_addrolemember N'Database_Executor', N'sqldbpool'
GO