Pages

Saturday, January 2, 2010

Get column values by comma separated in Sql Server

Get column values by comma separated in Sql Server
Introduction : In this article i will explain you how to get column's values by comma separated in sql server .
It is very easy to get all values of column in one string as separated by comma .

Query for get comma separated value of column in sql server :

Declare @Description varchar(4000)
select @Description = coalesce(@Description + ',' , '') + Name FROM UserTable
print @Description 


Output of query :
seta hamid , bhaumik vora ,vinayak , dave 


Related Other posts