Solved

Grant read access to SQL Management Server

Posted on 2014-11-14
7
72 Views
Last Modified: 2014-11-17
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
0
Comment
Question by:AXISHK
  • 3
  • 2
  • 2
7 Comments
 
LVL 15

Assisted Solution

by:Haris Djulic
Haris Djulic earned 250 total points
ID: 40442127
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
 
LVL 45

Expert Comment

by:Vitor Montalvão
ID: 40442128
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
 

Author Comment

by:AXISHK
ID: 40442551
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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 15

Expert Comment

by:Haris Djulic
ID: 40442587
use  GRANT EXECUTE ON SCHEMA::dbo TO USER
0
 

Author Comment

by:AXISHK
ID: 40444356
Tks, in case only need to explicitly grant few stored procedure to a user. How to achieve it ?
0
 
LVL 45

Accepted Solution

by:
Vitor Montalvão earned 250 total points
ID: 40446709
You need to run the following command for each SP and user:
GRANT EXECUTE ON StoredProcedureName TO Username

Open in new window

0
 

Author Closing Comment

by:AXISHK
ID: 40446726
Tks
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

There have been several questions about Large Transaction Log Files in SQL Server 2008, and how to get rid of them when disk space has become critical. This article will explain how to disable full recovery and implement simple recovery that carries…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

705 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now