SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 SQL Server Administration (2012)
 Grant Permissions on a list of Stored Procedures
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jazzcatone
Starting Member

12 Posts

Posted - 08/01/2013 :  09:52:42  Show Profile  Reply with Quote
I have a list of existing stored proceudures that I can get by running the below query. I have a new sqluser called "XXXXXX" . How can I iterate through the result set in sql and give execute permissions to user XXXXXX. Any help or direction would be most appreciated.

Jason

SELECT [name]
FROM sys.objects obj
WHERE obj.[type] = 'P' and name like'JL_%'


Jason

James K
Flowing Fount of Yak Knowledge

3707 Posts

Posted - 08/01/2013 :  10:45:04  Show Profile  Reply with Quote
Modify the query to generate the grant statements, run it, copy the results to an SSMS query window and execute it
SELECT 'GRANT EXECUTE ON ' + [name] + ' TO XXXXXX'
FROM sys.objects obj
WHERE obj.[type] = 'P' and name like'JL_%'
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000