Changes the owner of the current database.
This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Use ALTER AUTHORIZATION instead.
Applies to: SQL Server (SQL Server 2008 through current version).
After sp_changedbowner is executed, the new owner is known as the dbo user inside the database. The dbo has implied permissions to perform all activities in the database.
The owner of the master, model, or tempdb system databases cannot be changed.
To display a list of the valid login values, execute the sp_helplogins stored procedure.
Executing sp_changedbowner with only the login parameter changes database ownership to login.
You can change the owner of any securable by using the ALTER AUTHORIZATION statement. For more information, see ALTER AUTHORIZATION (Transact-SQL).
The following example makes the login Albert the owner of the current database.
EXEC sp_changedbowner 'Albert';