We help IT Professionals succeed at work.

How can I retrieve the column names from a T-SQL table?

Bruce Gust
Bruce Gust asked
on
53 Views
Last Modified: 2018-04-06
I've seen several approaches to this dilemma, but nothing seems to be working. Probably missing something, but here's what I've got:

screenshot
What I want to do is construct a SELECT that retrieves the names of my columns. In this instance, I would expect to see something like:

debatchid
eventname
description
contactinfo
confirmation etc...

Instead, I get what you see in the screenshot = "column_name, TABLE_CATALOG, TABLE_SCHEMA..."

What do I use to get my column names?

Thanks!
Comment
Watch Question

SQL Server Data Dude
CERTIFIED EXPERT
Most Valuable Expert 2013
Author of the Year 2015
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Bruce GustPHP Developer

Author

Commented:
Perfect!

Thanks!
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.