Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

How to change ownership of table Expand / Collapse
Posted Wednesday, February 18, 2009 2:06 AM


Group: General Forum Members
Last Login: Wednesday, March 25, 2009 3:12 AM
Points: 10, Visits: 27

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

Post #659158
Posted Wednesday, February 18, 2009 2:38 AM

Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Tuesday, September 8, 2015 6:41 PM
Points: 309, Visits: 831
Use this Code
EXEC sp_changeobjectowner 'tablename', 'user or role'

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.

My Blog ->
Post #659178
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse