Both schema and ownership have the same format of schema_name/owner_name.object_name. When I see something like this, how do I know it's a schema or an owership?
Both schema and ownership have the same format of schema_name/owner_name.object_name. When I see something like this, how do I know it's a schema or an owership?
If it is in SQL Server 2005/2008 then it is Schema.object_name. Now, at time of creation the schema will normally default if no action is taken to the owner's name, but once the object is created the owner name and schema name are separate entities and tracked entirely separately.
If you want to find the objects owner, you have several options, but the easiest is to right click on the object in SSMS and go to properties.
In SQL Server 2000 it's quite simple - everything is the same, because users and schemas are the same thing. The majority of objects are schema-scoped, so it's easy to understand.
In 2005 and 2008, it gets more complex, because a lot more of the objects are spread across differenct scopes. So you have schema-scoped objects, which belong to a schema, database-scoped objects which belong to a database, and server-scoped objects which belong to the server as a whole.
Both schema-scoped and database-scoped objects have owners - thus you can use the ALTER AUTHORIZATION statement to change the owner of an object.
For schema-scoped objects, the default owner is the owner of the schema to which the objects belong.
No one has followed this question yet.