This article is half-done without your Comment! *** Please share your thoughts via Comment ***
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:
1 2 3 4 |
CREATE ROLE SP_Executor GO GRANT EXECUTE TO SP_Executor GO |
Create database user and assign this role to it:
1 2 3 4 |
CREATE USER dbrnd FOR LOGIN Database_Readonly_User GO EXEC sp_addrolemember N'SP_Executor', N'dbrnd' GO |
Assign EXECUTE permission for a particular stored procedure:
1 |
GRANT EXECUTE ON [usp_MyStoredProcedure] TO dbrnd |
Leave a Reply