Re: Adding Win 2000 account to SQL Server database role

From: Sue Hoegemeier (Sue_H_at_nomail.please)
Date: 09/22/05


Date: Wed, 21 Sep 2005 20:00:41 -0600

Maybe you were trying it just through Enterprise Manager?
You need to use the system stored procedure to do this. Try
the following:
Create a new user on the machine.
In Query Analyzer, execute the following:
use northwind
go
sp_addrolemember 'db_datareader', 'YourMachine\YourUser'

The windows account will show up a user in the database with
access via group membership. You don't have to first add the
login or add the user to the database.

-Sue

On Wed, 21 Sep 2005 08:06:04 -0700, Nam
<Nam@discussions.microsoft.com> wrote:

>According to SQL Server 2000 Books online:
>
>"When you add a Windows NT 4.0 or Windows 2000 login without a user account
>in the database to a SQL Server database role, SQL Server creates a user
>account in the database automatically, even if that Windows NT 4.0 or Windows
>2000 login cannot otherwise access the database".
>
>My Questions: How can you add a login to a role without a user account (with
>that login) in the database? So, I don't understand the above comments. I was
>unable to create the above example since I had to create a win 2000 login as
>a user in the database first before adding that login to a role. Can someone
>please explain the above comments?
>
>Thanks,
>Kev



Relevant Pages

  • Re: Security controls in a web application
    ... one may be better off passing account management tasks ... to the operating system or database server ... I'm afraid that my web app is lacking of many security controls. ... I have implemented some security controls like a login page that asks ...
    (microsoft.public.security)
  • Re: Beginner security questions
    ... Since you've installed with "Windows Only" you may have a few steps to take ... You could try to create a user account on the SQL ... Reinstall sql server in mixed mode (remember to back up your database ...
    (microsoft.public.sqlserver.security)
  • Re: PDO: Switch database user without reopening connection
    ... At the bare minimum there will be a login user who only has ... modifications to the database as well (editors get update permission, ... As database connections are expensive to ... a certain visitor in the Session, and use that value to start the right ...
    (comp.lang.php)
  • RESTORING CRASHED SITE WEBS
    ... I reformatted and reinstalled Windows 2003. ... access using Windows Security the account returned in the failed login ... RESTORE ALL SQL AND WSS DATABASES ... I put in the database server name and existing ...
    (microsoft.public.sharepoint.windowsservices)
  • Re: Hard Drive Crash, Restoring to Original Registered User
    ... programs work except a database I use which is locked, ... Probably doesn't matter what name is used for your Windows account. ... Everytime a new user account is created, and new SID is assigned to it. ... The "registered to" isn't used by your database. ...
    (microsoft.public.windowsxp.general)