How to change ownership of table

  • Hi,

    How to change ownership of a table having dbo as owner to a specific owner without affecting the data of table in sql 2000...

    please specify steps to be followed.....

    Thanks,

  • Use this Code

    EXEC sp_changeobjectowner 'tablename', 'user or role'

    Note:

    Use sp_changeobjectowner to change the owner of an object if the security account that owns the object has to be dropped but the object must be retained. This procedure removes all existing permissions from the object. You will need to reapply any permissions you want to keep after running sp_changeobjectowner.

    For this reason, it is recommended that you script out existing permissions before running sp_changeobjectowner. Once ownership of the object has been changed, you may use the script to reapply permissions. You will need to modify the object owner in the permissions script before running

    Only members of sysadmin fixed server role, the db_owner fixed database role, or a member of both the db_ddladmin and db_securityadmin fixed database roles can execute sp_changeobjectowner.

    Regards,
    Sakthi
    My Blog -> http://www.sqlserverdba.co.cc

Viewing 2 posts - 1 through 1 (of 1 total)

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