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.
| Author |
Topic |
|
mrsaif
Starting Member
43 Posts |
Posted - 2006-04-05 : 06:44:11
|
| I have a table containing 4 rows. I want to get all records and first row as the column names.the data in my table is in this format.id name NIC1 Kalo 23547892 Bhasha 12547993 Tata 1245454How should I do thisMuhammad Saifullah |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2006-04-05 : 06:46:13
|
| select 'id, 'name', 'NIC'union allselect convert(varchar(20),id) , name, convert(varchar(20),NIC) from tblIt's an odd thing to want to do though.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-04-05 : 07:01:14
|
quote: Originally posted by mrsaifI have a table containing 4 rows. I want to get all records and first row as the column names.
Why do you want do to this ? KH |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-04-05 : 08:56:05
|
| Note that if you use this in query all datatypes should be of varchar type. Use Front end application to show the column names from recordsetMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|