Solved

DB ACCESS Stored Procedure

Posted on 2004-10-13
3
355 Views
Last Modified: 2012-08-13
Is there a stored procedure for adding db access such as db_datareader, db_datawriter that can be scripted ? i have tried sp_addrole, sp_grantdbaccess but these don't address the specific database acesss.
0
Comment
Question by:Auerelio Vasquez
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 34

Accepted Solution

by:
arbert earned 500 total points
ID: 12303647
Not totally what you want, but this will add a user to the db_datareader:

EXEC sp_addrolemember 'db_datareader', 'youruserhere'
0
 
LVL 1

Author Comment

by:Auerelio Vasquez
ID: 12304656
Will this work with a current user ? and can i add multi attributes, like db_datareader and db_datawriter ?

0
 
LVL 34

Expert Comment

by:arbert
ID: 12305019
Ya, the above works only for a current user.  To add multiple roles, you would have to execute it multiple times with the different role...

Brett
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question