Re-linking database user

290 pts.
Tags:
Alter user
SQL Server 2005
SQL Server database
Hi Guys, What I am trying to do is relink a database user to a new domain user, and also keeping the same database user name. I am able to do this when I run the following command, and if the database user isn't the same as the login name. use temp alter user TestUser2 with name= TestUser2, login= [BBATestUser1] But what happen is when the database user is the same as my login name, CCTestUser2, I can't relink it. So when I run use temp alter user [CCTestUser2] with name= [CCTestUser2], login= [BBATestUser1] I get the following error "The name change cannot be performed because the SID of the new name does not match the old SID of the principal." I think this occur cause sid of [CCTestUser2] and [BBATestUser1] is different. How can I resolve this, cause some of my database user name has the same name as my login name. Thanks in advance..
ASKED: October 1, 2008  12:18 PM
UPDATED: October 2, 2008  12:48 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.

You will want to use <a href=”http://itknowledgeexchange.techtarget.com/sql-server/back-to-basics-how-do-i-use-sp_change_users_login/”>sp_change_users_login</a> to realign the user with the login.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following