[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 455
  • Last Modified:

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





0
SiemensSEN
Asked:
SiemensSEN
  • 2
2 Solutions
 
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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now