Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table, and Field name

Status
Not open for further replies.
Apr 14, 2004
22
US
Hi,

How can I write a query that will return a table names ,a nd its field names.

something like this:
Select Name from dbo.sysobjects where xtype = 'u' AND NAME NOT IN('dtproperties')

This only return table name, I need the table names with field names.

Thank you

Salim Bhura
 
Use the information schema views.
Code:
select *
from INFORMATION_SCHEMA.TABLES
where table_name <> 'dbproperties'

Denny

--Anything is possible. All it takes is a little research. (Me)

[noevil]
 
Specifically, the columns one:

Code:
SELECT * FROM INFORMATION_SCHEMA.Columns

-------------------------------------
It is better to have honor than a good reputation.
(Reputation is what other people think about you. Honor is what you know about yourself.)
 
oh, yeah, i'm a dope and gave the wrong view name.

Denny

--Anything is possible. All it takes is a little research. (Me)

[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top