You can get column names for X table from the [INFORMATION_SCHEMA] so your select statement might literally look like this:
SELECT
[COLUMN_NAME]
FROM
[INFORMATION_SCHEMA]
WHERE
[TABLE_NAME] = 'yourtablename'
hth
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for:
Professional Search Engine Optimization with ASP.NET
Professional IIS 7 and ASP.NET Integrated Programming
Wrox Blox: Introduction to Google Gears
Wrox Blox: Create Amazing Custom User Interfaces with WPF and .NET 3.0
================================================== =========