How to get column values with comma seperated in sql server

DECLARE @ResultVar VARCHAR(1000)
SELECT @ResultVar = COALESCE(@ResultVar + ', ', '') + CAST(TickerSymbol AS varchar(50))
FROM  company

print @ResultVar

Comments

Popular posts from this blog

How to Convert Word Document to PDF using C#

How to Get First Day and Last Day of a Current Quarter in SQL Server