Friday, February 24, 2012

How to query the list of table (DD) of a user DB

Hello there
I want to know if there is a way in sql server to query the list of
objects in a user DB. especially tables.
thanksSELECT *
FROM information_schema.tables
WHERE TABLE_TYPE = 'BASE TABLE'
AND OBJECTPROPERTY(OBJECT_ID(TABLE_NAME), 'IsMSShipped') = 0
Keith
"Simo Sentissi" <simo@.sentissiweb.com> wrote in message
news:e3ZU196rEHA.3608@.TK2MSFTNGP14.phx.gbl...
> Hello there
> I want to know if there is a way in sql server to query the list of
> objects in a user DB. especially tables.
> thanks|||Use information_schema views.
Example:
select * from information_schema.tables where
objectproperty(object_id(table_name), 'IsUserTable') = 1
mk:@.MSITStore:C:\Program%20Files\Microso
ft%20SQL%20Server\80\Tools\Books\tsq
lref.chm::/ts_ia-iz_4pbn.htm
AMB
"Simo Sentissi" wrote:

> Hello there
> I want to know if there is a way in sql server to query the list of
> objects in a user DB. especially tables.
> thanks
>|||http://www.aspfaq.com/search.asp?q=schema:&type=ALL
http://www.aspfaq.com/
(Reverse address to reply.)
"Simo Sentissi" <simo@.sentissiweb.com> wrote in message
news:e3ZU196rEHA.3608@.TK2MSFTNGP14.phx.gbl...
> Hello there
> I want to know if there is a way in sql server to query the list of
> objects in a user DB. especially tables.
> thanks

No comments:

Post a Comment