Transferring Ownership of a Database Object

Use the Transfer Database Owner wizard to change ownership of database objects.

You can also search for referencing objects in the current, or other databases, that will be affected if the selected object is transferred to a different owner. If referencing objects exist, you can generate the SQL scripts to create these objects with the new owner. You can also compare the scripts to create the object with the old and new owners.

To transfer object ownership with referencing objects, first save the script that creates referencing objects with the new owner, then click through the wizard to transfer the database object ownership. When the transfer is complete, run the script to modify ownership of the referencing objects.

Note: Ownership of dbo-owned objects can be transferred only by users with an sso_role. Users cannot also have an sa_role and users cannot be a database owner (dbo).
  1. In the Administration Console view, select ASE Servers > Security > Users.
  2. Click the Name field of the user, then click the drop-down arrow and select Transfer Database Object.
  3. Select the type of objects to be transferred to a new owner.
  4. Select the specific objects. Click Preserve Permissions to retain the old permissions for those objects.
  5. Select one of these new owner options:
    • Select the new user name – when you choose this option, you must also specify additional information:
      • In the Database to Search screen, select the databases to be searched for objects that reference the object for which you are changing the owner.
      • In the Object References screen, you can:
        • Save the script that is automatically generated for referencing objects – you must run the saved script, outside of SAP Control Center, to create new instances of the referenced objects with the updated owners.
          Note: Run the script only after you have changed the owner, that is, after the Transfer Database Object wizard has completed.
        • Compare the two scripts (one that creates the object with the old owner and the other with the new owner) – click the Name field of the row containing the object, then click the icon that appears. Upon comparing the two scripts, select Accept to retain the object in the list of referencing objects included in the script, or Reject to remove the corresponding object entries from the script.
    • Select the new login name – change the loginame value (in system catalog sysobjects) of the selected objects only.
      To be available for selection, a login must meet these conditions:
      • If the current owner is guest, the login name must be valid, cannot have sa_role, and the login suid cannot be in the sysusers or sysaliases tables.
      • If the current owner is dbo, the login name must be valid, the login suid must be either in the sysaliases table that is aliased to the dbo, or have sa_role.
      • If the current owner is anyone else other than guest or dbo, the login name must be valid and the login suid must be in the sysaliases table that is aliased to the current owner.
  6. (Optional) Click Summary to verify your selected options.
Related tasks
Creating a Group
Creating a User