SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Returning Table Column Names
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

tchinedu
Yak Posting Veteran

71 Posts

Posted - 11/07/2005 :  18:12:59  Show Profile  Reply with Quote
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

USA
35932 Posts

Posted - 11/07/2005 :  18:15:15  Show Profile  Visit tkizer's Homepage  Reply with Quote
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 - 11/07/2005 :  19:45:40  Show Profile  Reply with Quote
Thank You so much...very much appreciated

Edited by - tchinedu on 11/07/2005 19:46:03
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
35932 Posts

Posted - 11/07/2005 :  19:46:00  Show Profile  Visit tkizer's Homepage  Reply with Quote
quote:

Thank You sir



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

Tara Kizer

Edited by - tkizer on 11/07/2005 19:49:18
Go to Top of Page

robvolk
Most Valuable Yak

USA
15635 Posts

Posted - 11/07/2005 :  20:33:44  Show Profile  Visit robvolk's Homepage  Reply with Quote
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

USA
4184 Posts

Posted - 11/07/2005 :  21:36:27  Show Profile  Visit derrickleggett's Homepage  Send derrickleggett an AOL message  Send derrickleggett a Yahoo! Message  Reply with Quote
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

India
22713 Posts

Posted - 11/08/2005 :  00:32:27  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
>>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

USA
1 Posts

Posted - 11/04/2012 :  07:32:55  Show Profile  Reply with Quote
Thank you Tara
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000