change object owner by user | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

change object owner by user

hi there,
is there a way to change an object’s owner by a app-user ( not sa, not user in admin role) within a application? the process will be something like this: create table abc ()
grant select to my_client (role)
change owner to dbo I know user can use create dbo.object_name to create an object as owned by dbo. or admistrators can change the object’s owner to someone else by running sp_changebojectowner, but that is not what i’m looking for. thanks!

From BOL:
‘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.’ You can always run:
USE master
GO sp_helptext ‘sp_changeobjectowner’
GO
and analyze how sp_changeobjectowner exactly works to create your own procedure. — Rediscover the web
http://www.mozilla.org/firefox/

]]>