ALTER AUTHORIZATION (TSQL Statement)
changes the owner of the database.
Syntax
ALTER AUTHORIZATION
ON DATABASE::database_name
TO login_name
Arguments
- database_name
- name of the database
- login_name
- is the login name of the new owner of the database.
Remarks
Only sa or dbo is allowed to execute this statement.
By default, all new databases are owned by login sa.
The owner of a database is the login of the dbo user.
To remove the ownership of the database from a login, you must specify another login as new owner. It can be sa.
Examples
ALTER AUTHORIZATION ON DATABASE::clients TO alice; -- new owner is login alice
ALTER AUTHORIZATION ON DATABASE::clients TO sa; -- new owner is login sa