Sql Server 2005 how to change dbo login name Sql Server 2005 how to change dbo login name sql-server sql-server

Sql Server 2005 how to change dbo login name


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


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'


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

USE [My_Database_Name]GOEXEC dbo.sp_changedbowner @loginame = N'domain\abc', @map = falseGO