Reply to Re: Output Column names in each Row along with the row Value

Your name:

Reply:


Posted by M A Srinivas on 06/29/07 12:27

On Jun 29, 3:09 pm, Yas <yas...@gmail.com> 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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация