In this post, I am sharing one permission script to assign EXECUTE permission to the SQL Server Database User.
Generally, we are creating separate read only database user with limited access.
We are assigning only SELECT permission on some the tables and views for a particular read only database user.
But sometimes, this user also require to EXECUTE all stored procedures or a particular stored procedure.
Create a new database role and assign EXECUTE permission:
CREATE ROLE SP_Executor
GRANT EXECUTE TO SP_Executor
Create database user and assign this role to it:
CREATE USER dbrnd FOR LOGIN Database_Readonly_User
EXEC sp_addrolemember N'SP_Executor', N'dbrnd'
Assign EXECUTE permission for a particular stored procedure:
GRANT EXECUTE ON [usp_MyStoredProcedure] TO dbrnd
Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.
If you like this post, then please share it with others.
Please follow dbrnd.com, I will share my experience towards the success of Database Research and Development Activity.
I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.