A system administrator might want to create the user databases and give ownership of them to another user after completing some of the initial work. sp_changedbowner changes the ownership of a database. The procedure must be executed by the system administrator in the database where the ownership is to be changed. The syntax is:
sp_changedbowner loginame [, true ]
The following example makes the user “albert” the owner of the current database and drops the aliases of users who could act as the former “dbo.”
sp_changedbowner albert
The new owner must already have a login name in Adaptive Server, but he or she cannot be a user of the database or have an alias in the database. You may have to use sp_dropuser or sp_dropalias before you can change a database’s ownership. See the Chapter 13, “Getting Started With Security Administration in Adaptive Server,” for more information about changing ownership.
To transfer aliases and their permissions to the new database owner, add the second parameter, true.
You cannot change ownership of the master database. It is always owned by the “sa” login.