Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

user mapping by default ? Expand / Collapse
Author
Message
Posted Friday, January 31, 2014 7:59 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, April 15, 2014 6:18 AM
Points: 53, Visits: 220
Is there a way to add a user mapping for a particular login so that the login gets read access to all new databases?

(Add a mapping to model db ??)

How about all existing databases?

Post #1536792
Posted Friday, January 31, 2014 8:51 AM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Yesterday @ 11:25 AM
Points: 539, Visits: 796
For this case I would create a windows group that has data reader access and manage the group for who get's access. After that add that group to your db_datareader database role in Model. Now when a new database is created (not restored from backup that won't work) it will inherit the db_datareader role access from Model.

To configure you existing database I would use sp_msforeachdb to create a DB user for the login and then alter the db_datareader role to add the user as a member.




Microsoft Certified Master - SQL Server 2008
Follow me on twitter: @keith_tate

Forum Etiquette: How to post data/code on a forum to get the best help
Post #1536817
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse