Using the with override option with create database  Using the alter database command

Chapter 6: Creating and Managing User Databases

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. 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.

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





Copyright © 2005. Sybase Inc. All rights reserved. Using the alter database command

View this book as PDF