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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

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

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 How to SELECT Field Name ONLY?
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

knockyo
Yak Posting Veteran

83 Posts

Posted - 07/16/2007 :  23:46:58  Show Profile  Reply with Quote
Hi,

Actually I just want to SELECT the table with FIELD NAME only. I don't want select all the records.

Hope can guide me.

Thanks.

khtan
In (Som, Ni, Yak)

Singapore
17689 Posts

Posted - 07/16/2007 :  23:51:17  Show Profile  Reply with Quote
SELECT * FROM TABLE WHERE 1 = 2

OR

SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'yourtable'



KH
Time is always against us

Go to Top of Page

rahulnadkarni
Starting Member

5 Posts

Posted - 07/16/2007 :  23:51:34  Show Profile  Reply with Quote
Hi,

I think currently you aretrying
Select * from [TableName]

You need to try as:
Select [FieldName1] , [FieldName2] FROM [TableName]

Thanks,
Rahul
Go to Top of Page
  Previous Topic Topic Next 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