Add Database Role to Login Name

From: Joe K. (K._at_discussions.microsoft.com)
Date: 04/27/05


Date: Wed, 27 Apr 2005 14:09:43 -0700


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: "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)
  • Re: SQL 2000 SP3 DB User Login Name changes
    ... database to a different server. ... I'm not sure why you have different behavior with attach vs. restore. ... > [Notice that the dbo user incorrectly has 'sysdba' as a Login Name after ...
    (microsoft.public.sqlserver.security)