Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 readonly access to all views in a DB

Author  Topic 

2k2er
Starting Member

20 Posts

Posted - 2011-07-08 : 09:25:36
Hi Team,

I want to grant a windows user, a read-only access to all the views in one of the SQL DB. Can someone tell me how to do that? I have both SQL 2005 and SQL 2000 DB in place and i have to allow him this access on both.

Thanks for your help.
2k2er

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2011-07-08 : 09:28:17
Create a role.
Give that role readonly access to the views
add the user to the role.


==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

2k2er
Starting Member

20 Posts

Posted - 2011-07-08 : 10:07:02
Thanks. Management is Ok to allow him the db_datareader role. So it makes my job easier. I have done with my SQL 2000 DB. Now in SQL 2005, i don't see this db_datareader role. Do we have any other equivalent role which functions in the same way like db_datareader?
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2011-07-08 : 10:28:35
db_datareader exists in SQL 2005. Not sure where you're looking.

EXEC sp_AddRoleMember 'db_datareader', 'userNameHere';
Go to Top of Page

2k2er
Starting Member

20 Posts

Posted - 2011-07-08 : 13:05:49
Thanks man. I got.
Go to Top of Page
   

- Advertisement -