0 votes
1 view
in SQL by (20.3k points)

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

GRANT EXECUTE TO [MyDomain\MyUser]

1 Answer

0 votes
by (40.4k points)

For SQL Server 2008 and Above version, you can use the below code:

/* TO CREATE A NEW ROLE */

CREATE ROLE db_executor

/* TO GRANT EXECUTE TO THE ROLE */

GRANT EXECUTE TO db_executor

For the user (not a role), you can use the below code:

USE [DBName]

GO

GRANT EXECUTE TO [user]

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...