Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2009

    Unanswered: How to change table owner in ASE ??

    How to change table owner in ASE ??

    Is this possible? Or drop create is the only option

  2. #2
    Join Date
    Jun 2009
    I think there is no sybase supported way for changing ownership of a object.But there is only this workaround, which is not supported, so it should be used with care:

    - kick out all users and login the server and make sure they do not log in while this is happening (for example: restart the server on a different port that the clients don't know about)

    - manually update sysobjects.uid to the value you want

    - shutdown and reboot your server

    - if permissions have been set specifically for this object, you will likely
    need to remove and recreate those; then shutdown & reboot again. you'll need
    to figure out what has currently been set and how to recreate those
    settings. sp_helprotect or ddlgen will be useful here.

    - now you can let users in again


  3. #3
    Join Date
    Jun 2009
    South Africa
    I agree with erovij, as there is no supported method to directly do this.

    If you update the uid of the object to the new owner's uid, you might also want to update the "loginame" column of the same object. This column contains the user name that actually created the object, even though the object may belong to a different user.

    If any created object contains a username in the "loginame" column that you want to drop from the database, ASE will (incorrectly) tell you that the user cannot be dropped, as it still own objects in the database.

    EDIT: You will need to allow ad-hoc updates to the catalog to do this (sso_role required):

    sp_configure 'allow updates', 1
    .. do the changes, and then deny the updates again
    sp_configure 'allow updates', 0
    Last edited by Lerac; 07-21-09 at 18:19.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts