Click here to Skip to main content
16,012,508 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My table has following
Pname qty
kova   3
Cheese  3
Paneern 4
<pre>

I Want to display like this
Pname  qty


I want display table heading only

How to do it.Please help me
Posted

SQL
Select * from [TableName] where 1=2 
 
Share this answer
 
Hi,

This is for general SQL, we can use this technique to all sql database. To get Headers only for a query or any table we need to use any false condition. A false condition can be any like 1=0, 1=0, 'a' = 'b' etc...

in SQL Server If you want to get structure for any table you can use sp_help [^] stored procedure[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900