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 2005 Forums
 Transact-SQL (2005)
 How to SELECT Field Name ONLY?
 New Topic  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
17595 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  
 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.06 seconds. Powered By: Snitz Forums 2000