Saturday, February 25, 2012

Change table owner

Hi,

I imagine losts of people already asked the question but i can't find out the answer on this forum or on the web

I want to change the owner of some tables in one database.

How do i do ?

I think sp_changedbowner is not help cause i want the table, not the database owner to be changed.

Do i have to change sysobjects ? If so, what is the way to do ?YOU CAN USE THIS.
HOPE THIS HELPS ...

EXEC SP_CHANGEOBJECTOWNER 'TABLE_NAME', 'OWNER_NAME'

BUT THE NEW OWNER MUST HAVE ACCESS TO THE DATABASE WHERE THE TABLE IS RESIDING.

NIVAS.|||As i needed fast answer i used the following command wich produces the same thing i think :

update sysobjects set sysobjects.uid=9 where sysobjects.xtype in ('D','U') and sysobjects.uid=99;

Thanks for the info anyway :)

No comments:

Post a Comment