Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Returning Table Column Names

Author  Topic 

tchinedu
Yak Posting Veteran

71 Posts

Posted - 2005-11-07 : 18:12:59
Please help guys, how do I write a query to return all the column names for a table in my database

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-11-07 : 18:15:15
SELECT COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'TableNameGoesHere'
ORDER BY ORDINAL_POSITION

Tara Kizer
Go to Top of Page

tchinedu
Yak Posting Veteran

71 Posts

Posted - 2005-11-07 : 19:45:40
Thank You so much...very much appreciated
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-11-07 : 19:46:00
quote:

Thank You sir



It's ma'am, not sir. There are females in the IT industry.

Tara Kizer
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-11-07 : 20:33:44
You're not a woman...you're a GODDESS.

Well, as long as the husband remembers, I guess it's all right if you forget once in a while.

CONGRATULATIONS!!!
Go to Top of Page

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2005-11-07 : 21:36:27
quote:

It's ma'am, not sir. There are females in the IT industry.



The best people I have ever worked for in the IT industry have been women.

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-11-08 : 00:32:27
>>how do I write a query to return all the column names for a table in my database

Run this also

sp_Columns 'yourTable'

quote:
There are females in the IT industry.

I have seen many clever women working well in the IT Industry. Tara, You are one of them

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

ITGuru
Starting Member

1 Post

Posted - 2012-11-04 : 07:32:55
Thank you Tara
Go to Top of Page
   

- Advertisement -