dbo not owner

  • I have 2 tables that have defaults and user defined data types that are not owned by dbo. Does anyone have a script or can you tell how to go about changing the owner to dbo. I a very new to sql server. Thanks.

  • use the sp_changeobjectowner stored procedure to change the ownership.

    Syntax

    sp_changeobjectowner [ @objname = ] 'object' , [ @newowner = ] 'owner'

    Steven

  • you need to run the

    use 'database'

    --the database where the objects are located

    sp_changeobjectowner 'obnectname','dbo'

    then you need to refresh the database you can see the change of the owner .

    saurabh


    saurabh

  • When you change the owner all permissions on the object are lost. You might have to script them out before you run that sp.

    Tom Goltl

  • I tried to use sp_changeobjectowner without any luck. I finally changed the properties for SS2k to allow updates to the system files. Then I changed the UID to the correct user(dbo) and undid the change I made to the properties for SS2k. Not a recommended way to make the change, but it worked.

  • Did you get a specific error when you tried sp_changeobjectowner? And also did you remember to use the existing owner to reference the object.

    sp_changeobjectowner 'existingowner.tablename', 'dbo'

    The reason is dbo is the only understood owner.

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

Viewing 6 posts - 1 through 5 (of 5 total)

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