SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Create User Account
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

kdeutsch
Yak Posting Veteran

USA
83 Posts

Posted - 01/22/2013 :  17:37:00  Show Profile  Reply with Quote
Ok,
bad implimentation i am trying to correct. What we have is a sql account that our asp applications use that has full permissions to the sql server, really bad. trying to correct it by createing a basing public account that needs , dbcreator, datareader, datawriter and ability to run stored procedures and look at views.

So i created the account but how can i assign the roles of datareader and writer globally and run stored procs without having to go into each db to do it.

Thanks

sodeep
Flowing Fount of Yak Knowledge

USA
7174 Posts

Posted - 01/23/2013 :  21:54:21  Show Profile  Reply with Quote
Why Full Permission? Do you have DBA or no?
Go to Top of Page

Peter99
Constraint Violating Yak Guru

481 Posts

Posted - 01/24/2013 :  09:51:20  Show Profile  Reply with Quote
Right click on login name, select properties, select user mapping, in top window "users mapped to this login" select select database name, in lower winow "database role membership" select permissions you want to give.
Go to Top of Page

kdeutsch
Yak Posting Veteran

USA
83 Posts

Posted - 01/24/2013 :  11:26:17  Show Profile  Reply with Quote
hi,
No DBA, I created everything want I am wonder though is instead of each database over 120, can I set it globally to be a dd_Reader, DB_Writer and execue on SP's. instead of having to go into each DB to do this.

Thanks
Go to Top of Page

srimami
Posting Yak Master

160 Posts

Posted - 01/29/2013 :  03:42:01  Show Profile  Reply with Quote
Execute the following script to assign permissions for all the databases:

sp_msforeachdb
exec sp_addrolemember @rolename='db_datareader', @membername='THE_LOGINAME'

Note: Please work on syntax errors
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000