Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I restored a db on my SQL 2000 server called R1. I went to add R1 to the user mapping of a user called JUNO. I get an error:

User or role 'JUNO' already exists in the current database.

So I ran on R1 as SA I ran:

DROP USER JUNO

And got:

Incorrect syntax near the keyword 'USER'.

So I tried:

EXEC dbo.sp_revokedbaccess N'JUNO'

Another error:

Msg 15183, Level 16, State 1, Procedure sp_MScheck_uid_owns_anything, Line 17
The user owns objects in the database and cannot be dropped.
Msg 15284, Level 16, State 1, Procedure sp_MScheck_uid_owns_anything, Line 34
The user has granted or revoked privileges to the following in the database and cannot be dropped.

My goal is not to drop JUNO... but to allow JUNO to access the db. Using a different user name is not an option.

Any ideas?

share|improve this question
    
The title of this question could use some love so if you think of one let me know. –  NitroxDM Sep 20 '10 at 20:31
add comment

1 Answer

up vote 1 down vote accepted

Looks like this did the trick:

sp_change_users_login 'Update_One', 'JUNO', 'JUNO'
share|improve this answer
    
What that stored procedure does is update the guid in the database for the user JUNO so that it matches the guid in the master database for the login JUNO. When these are matched up the user is able to log into the database. –  mrdenny Sep 20 '10 at 22:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.