Getting MS SQL Table owner from vb

Posted on 2003-02-20
Medium Priority
Last Modified: 2010-08-05
Hi All,
I have database created when instalation. The database name and table owner create automatically as user entered.
I need to know the table owner using query so, I can use it for another query, because whenever I run the sql statement I always have to determine the table owner name. Example the sql statement like this:

select * from parameter

It is error, because the table parameter is not recognized. I have to write:

select * from user1.parameter.
User1 is the table owner. Whereas the table owner is not always user1.
Please Help.

Question by:VRGultom
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

Author Comment

ID: 7991983
I cancel this qustion. I have solve the problem. There is table sysobjects and sysusers in MS Sql to indentify the table owner.

Accepted Solution

hakyemez earned 70 total points
ID: 8020853
this query return your table OWNER name:
select u.name
from   sysobjects as o ,sysusers as u
where  o.name='<your_table_name>' and

Expert Comment

ID: 9276482
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Post your closing recommendations!  No comment means you don't care.

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
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 different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Suggested Courses

777 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