Re: Add Database Role to Login Name

From: Jens Süßmeyer (Jens_at_Remove_this_For_Contacting.sqlserver2005.de)
Date: 04/28/05


Date: Thu, 28 Apr 2005 07:26:36 +0200

Syntax
sp_addrolemember [ @rolename = ] 'role' ,
    [ @membername = ] 'security_account'

So it should be

sp_addrolemember 'db_datareader','CH-datareader-K'

HTH, Jens Suessmeyer.

---
http://www.sqlserver2005.de
---
"Joe K." <Joe K.@discussions.microsoft.com> schrieb im Newsbeitrag 
news:F7FFAA86-280E-45B2-93E3-F52AAB86D203@microsoft.com...
>
> I have a SQL Server 2000 database that I restore often.
>
> After the database is restored I need to add database security role to 
> Login
> Name Chicago\CH-datareader-K.
>
> How would I add the database role 'db_datareader' to Login Name
> Chicago\CH-datareader-K that correponds to User Name CH-datareader-K.
>
> Please help me create the correct syntax so I add this to my restore 
> script.
>
> Thanks, 


Relevant Pages

  • Re: Script A Login
    ... Yes, I do use Windows Authentication, but I am being asked to convert to SQL ... When I restore a database, ... database User Accounts and Database Roles are restored. ... Login in the server and the User Account in the database is broken? ...
    (microsoft.public.sqlserver.security)
  • Re: Script A Login
    ... exacutes a number of stored procedures against the database, ... Login and User ... I restore databases all the time and don't need to re-create logins or ... The user account should have been in the database ...
    (microsoft.public.sqlserver.security)
  • Re: SQL 2000 SP3 DB User Login Name changes
    ... already a user in the database'. ... >> I'm not sure why you have different behavior with attach vs. restore. ... Login Name ... >>> attach and the sysdba user doesn't have any Login Name. ...
    (microsoft.public.sqlserver.security)
  • Re: Backend Exchange migrate to New Hardware (Server)
    ... Exchange mailbox stores and Exchange public folder stores. ... When you use Backup to restore Exchange databases, ... Storage Engine to restore Exchange database files and their ...
    (microsoft.public.exchange.setup)
  • Re: "Best Practices" way to distribute MSDE
    ... Ways to put a database into a server: ... Restore a users's selected backup. ... if i'm supposed to be using MSDE now instead of Jet: ... > if you can't connect with that login, ...
    (microsoft.public.sqlserver.msde)