Change the ownership of an entity.
Syntax
ALTER AUTHORIZATION ON [class_type::] entity TO SCHEMA OWNER
ALTER AUTHORIZATION ON [class_type::] entity TO principal
Key
principal The name of the principal that will own the entity
class_type The class of the entity.
For SQL Server:
OBJECT | ASSEMBLY | ASYMMETRIC KEY | AVAILABILITY GROUP | CERTIFICATE |
CONTRACT | TYPE | DATABASE | ENDPOINT | FULLTEXT CATALOG | FULLTEXT STOPLIST |
MESSAGE TYPE | REMOTE SERVICE BINDING | ROLE | ROUTE | SCHEMA | SEARCH PROPERTY LIST |
SERVER ROLE | SERVICE | SYMMETRIC KEY | XML SCHEMA COLLECTION
For SQL database:
OBJECT | ASSEMBLY | ASYMMETRIC KEY | CERTIFICATE | TYPE | DATABASE | FULLTEXT CATALOG |
FULLTEXT STOPLIST | ROLE | SCHEMA | SEARCH PROPERTY LIST | SYMMETRIC KEY | XML SCHEMA COLLECTION
For Azure Synapse Analytics and Microsoft Fabric: OBJECT
For Parallel Data Warehouse: DATABASE | SCHEMA | OBJECT
entity_name Is the name of the entity.
principal_name | SCHEMA OWNER Name of the security principal that will own the entity.
Database objects must be owned by a database principal; a database user or role.
Server objects (such as databases) must be owned by a server principal (a login).
Specify SCHEMA OWNER as the *principal_name- to indicate that the object should be owned by the principal that owns the schema of the object.
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.
ALTER AUTHORIZATION ON OBJECT::tblParts TO Melinda;
ALTER AUTHORIZATION ON tblCustomers TO MichikoOsada;
GO
Change the database owner, you can also change this in Management Studio under Database ➞ Properties ➞ Files:
ALTER AUTHORIZATION ON DATABASE::SS64db TO sa
“One of the healthiest ways to gamble is with a spade and a package of garden seeds” ~ Dan Bennett