x

granting read access to databases in sql server 2000

hello all,

i am having 300 databases in which i have to grant read access to all,How to grant read access to all databases in Sql Server 2000 please suggest
more ▼

asked Mar 06 '12 at 01:22 PM in Default

sand143eep gravatar image

sand143eep
771 20 33 39

hello sorry to ask 'youruser' in the sence username please correct if i am wrong
Mar 06 '12 at 01:59 PM sand143eep
yes it is the username
Mar 06 '12 at 02:02 PM robbin
thanks a lot Robbin it worked one small question is there any difference in public and datareader as the user was executed as datareader but he was provided with public through the script please suggest if possible.
Mar 06 '12 at 02:18 PM sand143eep
The public role is a special database role to which every database user belongs. The public role captures all default permissions for users in a database. It cannot have users, groups, or roles assigned to it because they belong to the role by default. It is contained in every database, including master, msdb, tempdb, model, and all user databases.
Mar 06 '12 at 02:33 PM robbin
Thanks Robbin once again for your detailed clarification.
Mar 06 '12 at 03:13 PM sand143eep
(comments are locked)
10|1200 characters needed characters left

1 answer: sort newest

The actual snippet is quite simple

USE yourdb
go
sp_addrolemember 'db_datareader', 'youruser'
go
more ▼

answered Mar 06 '12 at 01:42 PM

robbin gravatar image

robbin
1.6k 1 3 5

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x1936
x472

asked: Mar 06 '12 at 01:22 PM

Seen: 1219 times

Last Updated: Mar 06 '12 at 03:13 PM