x
login about faq Site discussion (meta-askssc)

Differentiate Schema and Ownership

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?

more ▼

asked Oct 15 '09 at 01:14 PM in Default

RLM gravatar image

RLM
21 1 1 1

(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first

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.

more ▼

answered Oct 15 '09 at 01:25 PM

TimothyAWiseman gravatar image

TimothyAWiseman
14.5k 17 21 29

(comments are locked)
10|1200 characters needed characters left

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.

more ▼

answered Oct 15 '09 at 03:45 PM

Matt Whitfield gravatar image

Matt Whitfield ♦♦
29.2k 56 63 87

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x1843
x29
x4

asked: Oct 15 '09 at 01:14 PM

Seen: 1316 times

Last Updated: Oct 15 '09 at 01:29 PM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.