Changing database ownership

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, and can only 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:

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 Reference Manual: Procedures). See Chapter 13, “Getting Started with Security Administration in Adaptive Server,” in the System Administration Guide: Volume 1 for more information about changing ownership.

NoteYou cannot change ownership of the master database; it is always owned by the “sa” login.