Sql Server 2005 how to change dbo login name

Solution 1:

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

Solution 2:

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'

Solution 3:

PhantomTypist gives a good answer using the GUI. For achieving the same result with TSQL, you can use this code:

USE [My_Database_Name]
GO
EXEC dbo.sp_changedbowner @loginame = N'domain\abc', @map = false
GO