ALTER AUTHORIZATION

Change the ownership of an entity.

Syntax
      ALTER AUTHORIZATION ON [entity_type::] entity TO SCHEMA OWNER
      ALTER AUTHORIZATION ON [entity_type::] entity TO principal 

Key
   principal    The name of the principal that will own the entity

   entity_type  The class of the entity,
      one of:
        Database
        Schema
        XML Schema Collection
Assembly Role Object (table,view,function,procedure,queue,synonym) Fulltext Catalog Certificate Type Message Type Contract Service
Remote Service Binding Route Symmetric Key Endpoint

You cannot change the owner of a system database (master, model, tempdb), the resource database, or any database that is used as a distribution database. The ownership of entity types not listed above cannot be transferred.

Example

ALTER AUTHORIZATION ON OBJECT::tblParts TO BillG;
ALTER AUTHORIZATION ON tblCustomers TO MichikoOsada;
GO

"One of the healthiest ways to gamble is with a spade and a package of garden seeds" ~ Dan Bennett

Related commands:

CREATE SCHEMA
CREATE USER

Equivalent Oracle commands:

Imp/Exp or Create.. As Select..


© Copyright SS64.com 1999-2014
Some rights reserved