SQL

C

chs

Hi all:

Anyone has any ideas for how to use the SQL select command to
select the name of the columns of a table?
I found some select command for the first row which is not
the one
I needed.

cheers,
chs
 
A

Aaron Bertrand - MVP

SELECT COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME='table name'
 
C

Chris Barber

Go and read a short tutorial on 'basic' SQL and then repost any specific
questions that you have.
http://www.w3schools.com/sql/default.asp

NB: You want:

SELECT [FieldName]
FROM TableName

*** OPTIONAL WHERE CLAUSE ***
WHERE [Fieldname] = 'SomeValue'

eg. SELECT [UserID] FROM Users WHERE [Username] = 'Gerald87'

Would return a recordset with one field [UserID] with any records that have
[Username] equal to 'Gerald87'.

This sort of basic SQL statement can be used against any data source.
 
C

chs

Hi Mr. Chris Barber:
1) Isn't my question specified enough? I am looking for SQL command to
retrieve Access table's column name.(Please refer back to my previous post)
2) Just simple SQL commands...not the ADOX or recordset methods posted on
http://www.aspfaq.com/2177.
Thanks!
 
C

chs

Hi Mr. Chris Barber:
1) Isn't my question specified enough? I am looking for SQL command to
retrieve Access table's column name. (please refer back to first post)
2) Just simple SQL commands...not the ADOX or recordset methods posted on
http://www.aspfaq.com/2177.
Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,266
Messages
2,571,087
Members
48,773
Latest member
Kaybee

Latest Threads

Top