Solved

Error adding user mapping in sql server 2005

Posted on 2010-08-25
3
430 Views
Last Modified: 2012-05-10
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
Comment
Question by:SiemensSEN
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 30

Accepted Solution

by:
Rich Weissler earned 250 total points
ID: 33526883
Try:
USE <DB>
GO
EXEC sp_change_users_login 'Auto_Fix', '<user>'
GO
0
 

Author Comment

by:SiemensSEN
ID: 33526940
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
 
LVL 30

Assisted Solution

by:Rich Weissler
Rich Weissler earned 250 total points
ID: 33527277
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question