Table Owner

I am trying to view the owner of the tables inside Microsoft SQL management studio 2005. How can I do that I can not remember. All I see now is
 Name, Schema, and created
Who is Participating?
Scott PletcherConnect With a Mentor Senior DBACommented:
When you expand the "Tables" tab under the database, I think the name shows as "<schema_name>.<table_name>": schema_name is the table "owner" in SQL 2005 and later.
Been a while since I SQL'd but I think this will work:

use PutYourDBnameHere
SELECT FROM sysobjects a, sysusers b
where a.uid = b.uid and like 'PutYourTableNameHere'
and a.type='U'

Open in new window

(it might be "a.xtype" and not "a.type" dont recall)

Edit: you must run this inside a query - I think its Ctrl+F or Ctrl+N to open and Ctrl+E to execute.

Hope this helps! :)
Things have changed from 2005 it seems :)

However, there seems that schema_name is not always equal table owner....

To be blunt, I don't like this capability at all. The ability to do this isn't really talked about a lot in Books Online and I know in the 2005 version there was a lot of confusion when object owner was referenced. When you consider the following, it makes sense: the object owner is, by default, the owner of the schema. If no owner is actually specified for the object, the schema owner is the assumed owner. But you can have an object owner.

If the above is right (and I havent misunderstood) my query would still work....I think..
All Courses

From novice to tech pro — start learning today.