Re: Give more than one SQL user permissions to a DB
- From: "Dan Guzman" <guzmanda@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 8 Jun 2006 20:57:25 -0500
Are you asking for a script so that you don't have to click away using the
GUI? Perhaps the following will get you started. If you have a list of the
accounts in a SQL table (or syslogins), you can generate the script using a
SQL query.
USE MyDatabase
--add login (if necessary)
EXEC sp_grantlogin 'MyDomain\User1'
--specify default database (if desired)
EXEC sp_defaultdb 'MyDomain\User1', 'MyDatabase'
--add user to database
EXEC sp_grantdbaccess 'MyDomain\User1'
--
Hope this helps.
Dan Guzman
SQL Server MVP
<nospam@xxxxxxxxxxxxx> wrote in message
news:4vqg82pcidtghjujil89169t6a6t4l6nik@xxxxxxxxxx
We have over 200 SQL user accounts that need access to a DB. Because
of the way this software works they have to be individually created (I
would have preferred a group but can't do that with this software).
Anyway is there an easy way of give all 200 users access to this DB
without haveing to go to each account and selecting the DB?
Thanks
.
- References:
- Give more than one SQL user permissions to a DB
- From: nospam@xxxxxxxxxxxxx
- Give more than one SQL user permissions to a DB
- Prev by Date: In ADO.NET how to tread a large NTEXT field in small chunks? e.g. my NTEXT field is many megabytes but i only wat 10k at a time? how to do this in ADO.net?
- Next by Date: RE: Security settings for SSRS webservice access from SQLCLR
- Previous by thread: Give more than one SQL user permissions to a DB
- Next by thread: Re: Give more than one SQL user permissions to a DB
- Index(es):
Relevant Pages
|