Grant read access to SQL Management Server

How to grant a user to have read access to all object in a MS SQL 2008 R2, including the stored procedure created by other ?

Tks
AXISHKAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Haris DulicCommented:
You can create role for that specific case and then just add remove users from that role, i.e. use this code:

CREATE ROLE NEW_ROLE ;

GRANT EXECUTE SELECT ON SCHEMA::dbo TO NEW_ROLE 

EXEC sp_addrolemember 'NEW_ROLE ', 'NEW_USER'

Open in new window

0
Vitor MontalvãoMSSQL Senior EngineerCommented:
You can give to an user the db_datareader role permission but this is only to read data (table and views). For stored procedure and functions you need to grant execute permission for each created object.
0
AXISHKAuthor Commented:
Can we use TSQL to loop through all the user defined SQL Procedure and grant it to a user ? There are over a hundred of procedures ...

Tks
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Haris DulicCommented:
use  GRANT EXECUTE ON SCHEMA::dbo TO USER
0
AXISHKAuthor Commented:
Tks, in case only need to explicitly grant few stored procedure to a user. How to achieve it ?
0
Vitor MontalvãoMSSQL Senior EngineerCommented:
You need to run the following command for each SP and user:
GRANT EXECUTE ON StoredProcedureName TO Username

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AXISHKAuthor Commented:
Tks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2008

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.