3

If I create a new schema and set the schema owner to another schema, for example dbo, what is the meaning of that in regards to my new schema?

Does my new schema inherit the same permissions from it's owner dbo?

5

A Schema's owner is always a User (or Database Role). There may be a Schema with the same name as a User, because in very old versions of SQL Server a User and a Schema were the same thing. So there's still a User called dbo and a Schema called dbo in every database.

A Schema's owner is a User who has full control of the schema, and who will be the default owner of every object added to the schema. Owning an object suppresses permissions-checking on the object, and plays an important role in Ownership Chains.

  • 3
    Although rarely used in my experience, one can change the owner on individual objects with ALTER AUTORIZATION ON OBJECT::SomeObject TO UserWhoIsNotSchemaOwner such that the object owner is different than the schema owner. The schema owner will not be inherited in that case. – Dan Guzman Sep 11 at 11:03
  • @DanGuzman could you please elaborate on "such that the object owner is different than the schema owner" a little bit? I just stumbled on using the ALTER AUTHORIZATION ON SCHEMA::SchemaName TO User and then when I view the properties on that schema, it now shows the User as the Schema Owner. – J.D. Sep 11 at 12:30
  • You can issue ALTER AUTHORIZATION ON SomeSchema.SomeTable to switch the owner of a single object. It then no longer inherits ownership from the schema. But as @DanGuzman this functionality is so obscure that it's actually dangerous, given the serious security implications of Ownership Chains. – David Browne - Microsoft Sep 11 at 12:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.