views:

9639

answers:

3

I have a database with user 'dbo' that has a login name "domain\xzy". How do I change it from "domain\xzy" to "domain\abc".

A: 

This is a Windows login, not a SQL Server login, so you cannot 'change' the login name since it is linked to the user account in Active Directory.

Create a new Server Login (Windows) mapped to the new windows user (and remove the old one if necessary). Then in login's Security > User Mapping, permission that login to the appropriate database as user 'dbo' (or assign to the db_owner role)

+4  A: 

If you are trying to remap a login to a db user you can use sp_change_user_login

exec sp_change_user_login 'Update_One', 'user', 'login'

Thad
+7  A: 

I figured it out. Within SQL Management Studio you have to right-click on the database -> Properties -> Files -> Owner field. Change this field to the login name/account that you want associated with the "dbo" username for that database. Please keep in mind that the login name/account you choose must already be setup in the sql server under Security -> Logins

PhantomTypist
I needed to know this, 2 years later -- thank you.
Hogan
Thats a great find! +1
Sprintstar