May 16, 2002 at 9:00 am
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.
May 16, 2002 at 9:22 am
use the sp_changeobjectowner stored procedure to change the ownership.
Syntax
sp_changeobjectowner [ @objname = ] 'object' , [ @newowner = ] 'owner'
Steven
May 16, 2002 at 10:05 pm
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
May 17, 2002 at 7:54 am
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
May 17, 2002 at 7:37 pm
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.
May 17, 2002 at 8:22 pm
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