Changes the owner of a user database.
sp_changedbowner loginame[, true]
is the login name of the new owner of the current database.
transfers aliases and their permissions to the new database owner. Values are “true” and “TRUE”.
Makes the user “albert” the owner of the current database:
sp_changedbowner albert
The new owner must not already be known as either a user or alias (that is, the new owner must not already be listed in sysusers or sysalternates). Executing sp_changedbowner with the single parameter loginame changes the database ownership to loginame and drops aliases of users who could act as the old “dbo.”
After executing sp_changedbowner, the new owner is known as the Database Owner inside the database.
sp_changedbowner cannot transfer ownership of the system databases.
The new owner must already have a login name in Adaptive Server, but must not have a database user name or alias name in the database. To assign database ownership to such a user, drop the user name or alias entry before executing sp_changedbowner.
To grant permissions to the new owner, a System Administrator must grant them to the Database Owner, since the user is no longer known inside the database under any other name.
A user with sa_role or sso_role privileges can execute sp_changedbowner.
sp_changedbowner is used to change the owner of a database. You can execute it with either sa_role or sso_role privileges.
Values in event and extrainfo columns from the sysaudits table are:
Event |
Audit option |
Command or access audited |
Information in extrainfo |
---|---|---|---|
38 |
exec_procedure |
Execution of a procedure |
|
Commands create database
System procedures sp_addlogin, sp_dropalias, sp_dropuser, sp_helpdb