Changing database ownership

Use sp_changedbowner to change the ownership of a database. Often, system administrators create the user databases, then give ownership to another user after some of the initial work is complete. Only the system administrator can execute sp_changedbowner.

Sybase suggests that you transfer ownership before the user has been added to the database, and before the user has begun creating objects in the database. The new owner must already have a login name on Adaptive Server, but 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, and you may have to drop objects before you can drop the user.

Issue sp_changedbowner in the database whose ownership is to be changed. The syntax is:

sp_changedbowner loginame [, true ] 

This example makes “albert” the owner of the current database and drops aliases of users who could act as the old “dbo:”

sp_changedbowner albert

Include the true parameter to transfer aliases and their permissions to the new “dbo.”

NoteYou cannot change the ownership of the master, model, tempdb, or sybsystemprocs databases and should not change the ownership of any other system databases.