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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to sql for column names

Status
Not open for further replies.

mdwu

Technical User
Jul 17, 2003
98
US
What's the sql query to find the column names of table. thanks.
 
Code:
select * from information_schema.columns
where TABLE_CATALOG = 'YOUR_DATABASE'

[bandito] [blue]DBomrrsm[/blue] [bandito]
 
Sorry for a specific table:

Code:
SELECT * FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_CATALOG = 'YOUR_DATABASE'
AND TABLE_NAME = 'YOUR_TABLE_NAME'

[bandito] [blue]DBomrrsm[/blue] [bandito]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top