The Nerdrium

Welcome to the Nerdrium

Nerdy Stuff
Macintosh
Linux
Web Design
Case Mods
Gardening
Photography
Recipes

Find Column Titles With ColdFusion

by Michael Greifenkamp (April 21st, 2010)

I needed to find out the column titles of a SQL database, and without direct access to the DB itself, found that I could do it indirectly using a ColdFusion page.

It's pretty simple, really.

<cfQuery datasource="mydatasource" name="myCoolQuery">
SELECT * FROM tablename
</cfQuery>
<cfOutput>#myCoolQuery.ColumnList#>

That will output, for example, something like ID,FIRSTNAME,LASTNAME,LOCATION, etc.

Good luck!

--Michael

--Michael

Nerdy Stuff - Macintosh - Linux - Web Design - Case Mods - Gardening - Photography - Recipes
Home - About Us - Blog - Contact
Copyright © 2004 by Michael Greifenkamp