Link to home
Start Free TrialLog in
Avatar of Bruce Gust
Bruce GustFlag for United States of America

asked on

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

I've seen several approaches to this dilemma, but nothing seems to be working. Probably missing something, but here's what I've got:

User generated image
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!
ASKER CERTIFIED SOLUTION
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Bruce Gust

ASKER

Perfect!

Thanks!