Tuesday, 3 January 2012

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

No comments:

Post a Comment