how to chaver object owner ship

  • i am trying to change database object owner below

    es,EXEC sp_changeobjectowner 'authors', 'Corporate\GeorgeW';

    GO

    but i am getting this error

    Cannot change owner of object 'AUTHORS' or one of its child objects because the new owner 'dbo' already has an object with the same name.

    Note: i see the object is owned by dbo. authors and user.authors.

    what needs to be done.

  • check the credential for user 'Corporate\GeorgeW' he must be member of database role db_owner for the perticular database. Grant permission and try.

    ---------------------------------------------------
    "Thare are only 10 types of people in the world:
    Those who understand binary, and those who don't."

  • As you do have 2 objects dbo. authors and user.authors with same name like authors you can't change irrespective of database owner you can't change the ownership.

    There is a trick:

    1. rename object user.authors with user.authors_dummy

    2. Now you will be able to change the objectowner. change the objectowner to specific user

    3. rename object user.authors_dummy to user.authors.

    DONE!!!

    You need minimum permission to do this is db_owner.

    ---------------------------------------------------
    "Thare are only 10 types of people in the world:
    Those who understand binary, and those who don't."

  • try EXEC sp_changeobjectowner 'existing_owner .authors', 'Corporate\GeorgeW';

    GO

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply