Home > Archive > Microsoft SQL Server forum > July 2005 > Retrieving metadata









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Retrieving metadata
Shiva

2005-07-29, 9:23 am

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.


Razvan Socol

2005-07-29, 9:23 am

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

Simon Hayes

2005-07-29, 9:23 am


"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


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com