Re: Output Column names in each Row along with the row Value
- From: M A Srinivas <masri999@xxxxxxxxx>
- Date: Fri, 29 Jun 2007 05:27:03 -0700
On Jun 29, 3:09 pm, Yas <yas...@xxxxxxxxx> wrote:
Hello,
I was wondering if anyone can help me figure something out.
Is it possible to do a querey in MS SQL server and have the results
returned so that each result in each row is preceeded by the column
name?
eg. instead of usual output -> colName1, colValue1,
colName2,colValue2,colName3,colValue3 ?
Also I would like to only have this for certain columns ie in the
above example only for columns 2 and 3
Thank you! :-)
Yas
Not sure what you are actually looking at
create table #temp (col1 int, col2 int , col3 varchar(10))
insert into #temp values (1,10,'abcd')
insert into #temp values (2,20,'efgh')
select col1, ' col2:'+cast(col2 as varchar(10))+ '-col3:'+col3 as
col23
from #temp
drop table #temp
.
- Follow-Ups:
- References:
- Prev by Date: Re: Scope in derived tables
- Next by Date: Re: question about a query
- Previous by thread: Output Column names in each Row along with the row Value
- Next by thread: Re: Output Column names in each Row along with the row Value
- Index(es):
Relevant Pages
|