Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to grant user permission to execute all stored procedures in SQL 2005

Posted on 2010-11-19
5
Medium Priority
?
1,310 Views
Last Modified: 2012-05-10
Hello,

Is there a way in SQL 2005 to grant database user with permission to execute all stored procedures in the same database including store procs that will be created in the future?
I guess, I am looking for some kind of role based permission.
I understadn SysAdmin or db_owner roles are available.
However, I want to avoid over-granting permissions than required.

Thank you for your help,
0
Comment
Question by:JOSHUABT
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 4

Accepted Solution

by:
pbarry1 earned 2000 total points
ID: 34178007
Hi,

you need to grant EXECUTE permission at the database level.  So, all you need to do is:

GRANT EXECUTE TO UserName;

where UserName is the database user who need to execute any existing and future stored procedures.
0
 
LVL 4

Assisted Solution

by:pbarry1
pbarry1 earned 2000 total points
ID: 34178031
P.S. Just make sure your in the right database when issuing the command.

Or if you want, you can do this in the SQL Management Studio:
- right-click on the database name
  - Properties
  - Permissions
  - select the user you want
  - in the Permissions list, click on the GRANT option for EXECUTE
  - click OK and Voilà!


0
 

Author Comment

by:JOSHUABT
ID: 34178062
pbarry1,

Thank you for your response.
What about views in the same database?
How can I ensure the user can open any view in the same database?
0
 
LVL 4

Assisted Solution

by:pbarry1
pbarry1 earned 2000 total points
ID: 34178119
Unfortunately, there is no easy way to grant SELECT permission only on Views (current and future).  But if you don't mind also giving SELECT permission on all tables and all views, you could use the "db_datareader" role.

If you can't give SELECT permissions on all tables, here's what you could do:
-  Create a new role (ex: View Reader)
-  Manually GRANT SELECT on all existing view to this new role  (ex: View Reader)
- Create a Database scope trigger on the CREATE VIEW statement that GRANTs the SELECT permission for that new role (ex: View Reader).
0
 

Author Closing Comment

by:JOSHUABT
ID: 34178179
pbarry1
Thank you for your help.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to shrink a transaction log file down to a reasonable size.

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question