Wednesday, May 28, 2008

[itsdifferent] Re: Comma separated list of values of single Database table field

I would have just copied single column output in a text editor and did
a newline V/s Comma replacement.

--- In itsdifferent@yahoogroups.com, "sudev_gandhi" <sudev.gandhi@...>
wrote:
>
> Many times you need to create a comma seperated list of values in a
> table. Here is a line of T-SQL solution to get comma separated list of
> values of single field of a database table.
> DECLARE @commaSeparatedVal AS VARCHAR(MAX);
>
> SELECT @commaSeparatedVal = ISNULL(@commaSeparatedVal +',','') +
> CONVERT(VARCHAR,[SKU]) FROM PRODUCT
>
> PRINT @commaSeparatedVal
>
> Regards,
> Sudev Gandhi
> [Recent Articles On My Blog] <http://sudev.blogspot.com/>
>

__._,_.___
Note: This Group is not a Job Searching Group, so please co-operate and dont transfer any kind of job related material across this Group.AnyOne doing so can be banned from the Group
Thanx , Group Co-Ordinators
Y! Messenger

Send pics quick

Share photos while

you IM friends.

New web site?

Drive traffic now.

Get your business

on Yahoo! search.

Family Photos

Learn how to best

capture your

family moments.

.

__,_._,___

No comments: