Solved

DB ACCESS Stored Procedure

Posted on 2004-10-13
3
350 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:basile
  • 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:basile
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

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

In this article—a derivative of my DaytaBase.org blog post (http://daytabase.org/2011/06/18/what-week-is-it/)—I will explore a few different perspectives on which week today's date falls within using Microsoft SQL Server. First, to frame this stu…
Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now