If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Microsoft SQL Server > Setting up a read only user

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-18-12, 05:21
Breako Breako is offline
Registered User
 
Join Date: Jan 2006
Posts: 119
Setting up a read only user

Hi,
Simple question time.

I have a database instance which of course I can connect to and edit data. I would like to set up other users for this database that can just as easily connect but that only read data? What is easiest, quickest way? Thanks.

Alex.
Reply With Quote
  #2 (permalink)  
Old 01-18-12, 07:37
salliven salliven is offline
Registered User
 
Join Date: Jan 2012
Posts: 2
Read only database?

Hello,

It is my idea:
1.) Modify database to readonly true.
2.) Create full backup from the database.
3.) Restore a new database from the backup.
4.) Modify data in the new database.
5.) Create full backup from the new database.
6.) Restor old database from the newest backup.
7.) Modify database to readonly false.
Reply With Quote
  #3 (permalink)  
Old 01-18-12, 09:16
MCrowley MCrowley is offline
Wage drone 24601
 
Join Date: Jan 2003
Location: Massachusetts
Posts: 4,899
You can either add the user(s) to the db_datareader role in the database, or grant select permission on the schema.
Reply With Quote
  #4 (permalink)  
Old 01-18-12, 09:20
salliven salliven is offline
Registered User
 
Join Date: Jan 2012
Posts: 2
Deleted my post.
Reply With Quote
  #5 (permalink)  
Old 01-18-12, 09:59
Breako Breako is offline
Registered User
 
Join Date: Jan 2006
Posts: 119
Quote:
Originally Posted by salliven View Post
Deleted my post.
Ok thanks. There's plenty on the web around user roles... e.g. Understanding roles in SQL Server security | TechRepublic

I am wondering if anyone knows what SQL query I can run to check user roles?

Thanks.
Reply With Quote
  #6 (permalink)  
Old 01-18-12, 11:57
MCrowley MCrowley is offline
Wage drone 24601
 
Join Date: Jan 2003
Location: Massachusetts
Posts: 4,899
sp_helpuser
Reply With Quote
  #7 (permalink)  
Old 01-19-12, 05:48
Breako Breako is offline
Registered User
 
Join Date: Jan 2006
Posts: 119
Quote:
Originally Posted by MCrowley View Post
sp_helpuser
Thanks for everything.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On