Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Grant Permissions On SP's

Author  Topic 

sleake
Starting Member

2 Posts

Posted - 2007-11-30 : 08:08:38
I am trying to write a SQL script that grants execute permissions on all stored procedures for a single user (test_user).

I am running SQL server 2005

Does anyone have a script to do this.

Many thanks

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-11-30 : 08:17:06
The below command will generate GRANT statements for all the procedures in the current database:

Select 'GRANT EXECUTE ON [' + Specific_Schema + '].[' + Routine_Name + '] to test_user'
from information_schema.routines
Where Routine_Type = 'Procedure'


Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page
   

- Advertisement -