Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Table Owner

Posted on 2013-06-06
3
Medium Priority
?
308 Views
Last Modified: 2013-06-06
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
0
Comment
Question by:Jeff1976
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 3

Expert Comment

by:tsnirone
ID: 39226306
Been a while since I SQL'd but I think this will work:

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

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! :)
0
 
LVL 70

Accepted Solution

by:
Scott Pletcher earned 2000 total points
ID: 39226841
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.
0
 
LVL 3

Expert Comment

by:tsnirone
ID: 39226930
Things have changed from 2005 it seems :)

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

http://www.sqlservercentral.com/blogs/brian_kelley/2009/03/04/owning-an-object-in-sql-server-2005-2008/

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..
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question