h1

COALESCE – To Get Comma Separated List SQL SERVER

12/29/2008

Today in one report, i need to display the comma seprated data from table. So use the COALEASE feature and will share with you all.

You can use it like:

DECLARE @result VARCHAR(MAX)
SELECT @result = COALESCE(@result + ', ', '') + TestTejas.ColumnName
FROM
TestTejas

SELECT @result

Advertisements

2 comments

  1. Heya just wanted to give you a quick heads up and let
    you know a few of the pictures aren’t loading properly. I’m not
    sure why but I think its a linking issue. I’ve tried it in two different browsers and both show the same results.


  2. This article had taken the subject rather well. It offers
    everything discussed properly.



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: