Thread: SQL Server 2005
View Single Post
  #10 (permalink)  
Old 10-12-2007, 02:42 AM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 882
kingmaker is on a distinguished road
Send a message via Yahoo to kingmaker
Default ALTER AUTHORIZATION SQL Server 2005

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
__________________
The KINGMAKER
Makes Every Thing Possible

Stuffs (My Blog)
Reply With Quote