sys.sp_changedbowner

general
#stored-procedure

Description

Changes the owner of the current database. The login ID of the new owner of the current database. must be an already existing SQL Server login or Windows user. become the owner of the current database if it already has access to the database through an existing user security account within the database. To avoid this scenario, drop the user within This parameter is deprecated and is maintained for backward compatibility of scripts.

Syntax

sp_changedbowner
[ @loginame = ]
N
'loginame'
[ , [ @map = ]
'map'
]
[ ; ]