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.

It is a good idea to 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 will 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

To transfer aliases and their permissions to the new “dbo,” add the value true parameters.

NoteYou cannot change the ownership of the master database and should not change the ownership of any other system databases.