Error adding user mapping in sql server 2005

Hello,
  I just restore a database in SQLserevr 2005. Now I am trying to add the loging.

In SSMS 2005 I did teh following
Select security
Select the user
Select user mapping
click the checkboc netx the user name and enter the username and default schema
Select db owner and press ok


I get the error " user group or role  '<dbusername>' already exist in the current database

How do I fix this error.

Thanks





SiemensSENAsked:
Who is Participating?
 
Rich WeisslerProfessional Troublemaker^h^h^h^h^hshooterCommented:
Try:
USE <DB>
GO
EXEC sp_change_users_login 'Auto_Fix', '<user>'
GO
0
 
SiemensSENAuthor Commented:
Thanks ,
  That added the users . However, when I go to the database and select the security ->users and click the user 'user I don't see see any schemas under the 'Owned Schemas' section.
0
 
Rich WeisslerProfessional Troublemaker^h^h^h^h^hshooterCommented:
Actually, it didn't really add the schema -- the user already existed in the database, that just reconnected the two.  You should now be able to change the schema.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.