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