Search This Blog & Web

Showing posts with label Comma seperated. Show all posts
Showing posts with label Comma seperated. Show all posts

Friday, May 22, 2009

Returning Comma seperated Values in SQL Server 2005

Declare @vComma Varchar(max);

Select @vComma = COALESCE(@vComma+';','') + column1 from table1

select @vComma

I have 5 values in Unique table against Val column and this command will return all values as ; seperated