Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

Retrieving metadata
Hi,

Is it possible to get metadata (i.e. descriptions of tables etc.) in
sql-server? In Oracle you can retrieve this information with tables like
all_objects, user_tables, user_views etc. For example, this query selects
the owner of the table 'ret_ods_test' (in Oracle!):

select owner
from all_objects
where object_name = 'ret_ods_test'

What's the equivalent in sql server?

Thanks a lot.



Report this thread to moderator Post Follow-up to this message
Old Post
Shiva
07-29-05 02:23 PM


Re: Retrieving metadata
Here are some equivalent queries:

SELECT TABLE_SCHEMA
FROM INFORMATION_SCHEMA.TABLES
WHERE  TABLE_NAME='YourTabl
e'

SELECT USER_NAME(uid)
FROM sysobjects
WHERE name='YourTable'

Razvan


Report this thread to moderator Post Follow-up to this message
Old Post
Razvan Socol
07-29-05 02:23 PM


Re: Retrieving metadata
"Shiva" <gonzo@shiva.com> wrote in message
 news:dcdc2n$2nt$1@br
utus.eur.nl...
> Hi,
>
> Is it possible to get metadata (i.e. descriptions of tables etc.) in
> sql-server? In Oracle you can retrieve this information with tables like
> all_objects, user_tables, user_views etc. For example, this query selects
> the owner of the table 'ret_ods_test' (in Oracle!):
>
> select owner
>  from all_objects
> where object_name = 'ret_ods_test'
>
> What's the equivalent in sql server?
>
> Thanks a lot.
>
>

See sp_help, sysobjects, syscolumns, "Meta Data Functions", and the
INFORMATION_SCHEMA views in Books Online.

Simon



Report this thread to moderator Post Follow-up to this message
Old Post
Simon Hayes
07-29-05 02:23 PM


Sponsored Links





Last Thread Next Thread
Post New Thread

Microsoft SQL Server forum archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 12:35 PM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006