Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Error 21002 User Already Exists

Author  Topic 

Vack
Aged Yak Warrior

530 Posts

Posted - 2009-03-02 : 09:55:03
Had a server that crashed. Backed up the databases. Loaded SQL server 2000 service pak 3a onto a new Server. Restored the databases, did not restore the SQL databases that come with the install. master, model ....

Now when a user tries to connect to a database they cannot. Their login fails. When I go to the SQL server I see their Windows Name. I right click and go to properties and go to database access. The database they are trying to access is not checked. So I check the database and check dbowner at the bottom and hit ok. That is when ai receive the error 21002 User 'Don' Already Exists.


tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-03-02 : 10:43:45
You'll need to unorphan the accounts. Search for the unorphan accounts script here.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

tosscrosby
Aged Yak Warrior

676 Posts

Posted - 2009-03-02 : 14:18:36
Or you can do them one at a time using sp_change_users_login (more of a pain but it will work) - Check it out in BOL. It must be run within the database they are trying to access.

Terry

-- Procrastinate now!
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-03-02 : 14:43:12
That's what the script does that I was referring to, except you don't have to do it one at a time as it does them all in a loop.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -