Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Add User Mapping not working Expand / Collapse
Author
Message
Posted Tuesday, February 08, 2011 10:29 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, August 13, 2013 6:10 PM
Points: 66, Visits: 187
I'm trying to add a user mapping to an already existing login. In the Login Properties for the login, I need to add another database, so I check it and enter the User and Default Schema. When I click OK, it gives me an error 15023 saying that the user already exists. It's supposed to already exist, I'm just adding a User Mapping to this login. Help?
Post #1060421
Posted Tuesday, February 08, 2011 10:35 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Sunday, February 09, 2014 9:25 PM
Points: 1,200, Visits: 3,236
does the user is already added in the particular db??
Post #1060429
Posted Tuesday, February 08, 2011 2:45 PM
SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Yesterday @ 4:59 PM
Points: 4,056, Visits: 5,180
User mapping in the GUI attempts to create the user in the database you're trying to map to, thus the error you got.

Use sp_change_users_login to remap the existing database user to the existing login.

example: sp_change_users_login 'update_one', 'username', 'loginname'


Greg
Post #1060673
Posted Wednesday, February 09, 2011 6:00 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Sunday, February 09, 2014 9:25 PM
Points: 1,200, Visits: 3,236
I think some users got orphan.

exec sp_change_users_login 'REPORT'
--( run in every database to see which all logins got orphan)

Regards,
Sushant
Post #1061033
Posted Wednesday, February 09, 2011 7:53 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, August 13, 2013 6:10 PM
Points: 66, Visits: 187
Thanks guys, that did the trick...
Post #1061668
Posted Sunday, May 19, 2013 11:02 AM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, March 25, 2014 10:53 PM
Points: 62, Visits: 320
if there is login exist then delete and add login to corresponding user.
Post #1454351
Posted Sunday, May 19, 2013 11:59 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Wednesday, March 19, 2014 5:48 AM
Points: 1,048, Visits: 2,646
Hello,

sp_change_users_login will update the users, why do have to delete and update for each DB.

Note this is a old thread.


Regards
Durai Nagarajan
Post #1454407
Posted Monday, May 20, 2013 1:53 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, September 06, 2013 7:04 AM
Points: 2, Visits: 48
go Database name => security =>users then delete the user.
Add new user..
Any Problem .Let me know.
Post #1454424
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse