Retrieve only column names of table

reshma

Member
Joined
Mar 10, 2005
Messages
15
Programming Experience
1-3
Hi,
Can anyone send me the sql query to retrieve only the colum names of a table.


Thanks,
Reshma
 
OK, assuming you have a table in your schema named Customer, here is how you would list the columns for the customer table:


VB.NET:
select column_name from INFORMATION_SCHEMA.COLUMNS
where table_name = 'Customer';


The results will look similar to this:

column_name
-------------
cid
custid
firstnm
lastnm
title
compname
balance
custtype
billreportid
phone
fax
email
datestart
dateend
entityclass
holdstatus
duecalc
ntilldue
billcust
GroupTag
lockcycle
comment
 
Back
Top