Grant Execute to NT AUTHORITY\NETWORK SERVICE

Q. How can I 'spam' all the Stored Procedures in my own database using MSSQL 2005?

According to this link I'm on the right track, but...

http://www.sqldbatips.com/showarticle.asp?ID=8

This command completed successfully, but I didn't see any Execute permissions changed within my DB's SP's

Use MyDatabase

declare @u   sysname ; set @u = QUOTENAME('NT AUTHORITY\NETWORK SERVICE')

Grant Execute to QUOTENAME
LVL 1
kvnsdrAsked:
Who is Participating?
 
chapmandewConnect With a Mentor Commented:
If you are using 2005, you can grant exec easily to all stored procs tied to a schema..which in your case is most likley DBO.  Here is how:


grant exec on schema::dbo to [NT AUTHORITY\NETWORK SERVICE]

that way you don't have to worry about individual permissions....

this is what you are asking, right?
0
 
Faiga DiegelSr Database EngineerCommented:
Are you trting to grant execution of all your SPs to 'NT AUTHORITY\NETWORK SERVICE'?
0
 
kvnsdrAuthor Commented:
Yes, I just want to set Execute permissions for NT AUTHORITY\NETWORK SERVICE] on 1 database only, not the whole SQL Server......
0
2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

 
kvnsdrAuthor Commented:
Well, I get the typical "Command Completed Successfully' , but nothing changes on any SP's...

Even tried this one too:  

Use MyDatabase
Grant Execute to [NT AUTHORITY\NETWORK SERVICE]
0
 
chapmandewCommented:
OK, cool.  Tthe code I attached will give the user execute access on all stored procedures/functions in the database that you run the code in.  It won't do it for all database on the server, unless you run it individually for each database.
0
 
kvnsdrAuthor Commented:
I ran it like this, but it didn't work. None of my SP's in MyDatabase are changed.

Use MyDatabase
grant exec on schema::dbo to [NT AUTHORITY\NETWORK SERVICE]
0
 
Faiga DiegelConnect With a Mentor Sr Database EngineerCommented:

What do you mean by "None of my SP's in MyDatabase are changed"? It woudnt really change anything. You are just granting persission to execute the schema group to a specific account.
0
All Courses

From novice to tech pro — start learning today.