i want to get all the employee names in one cell in sqlserver. values should come with comma separated in one cell.
output
arvind
chang
deepak
desired output
Arvind, Chang, Deepak
query
select EmpName from Employee
i want to get all the employee names in one cell in sqlserver. values should come with comma separated in one cell.
output
arvind
chang
deepak
desired output
Arvind, Chang, Deepak
query
select EmpName from Employee
SELECT STUFF((SELECT ', ' + upper(left(EmpName,1)) + substring(EmpName,2,len(EmpName))
FROM Employee
FOR XML PATH('')) ,1,1,'') AS EmpName
I hope it will work for you.