Like on Facebook Share on Facebook on Twitter Reddit LinkedIn Pinterest
Newest Tips & Tricks...

Home :: Tips & Tricks :: Microsoft SQL Server

Return Comma-Delimited String

If you need to return a comma-delimited string such as a list of keywords from titles on your web page you can easily do this.

DECLARE @TopicNames varchar(200)
SELECT @TopicNames = COALESCE(@TopicNames + ',', '') + Topic FROM Topica
SELECT @TopicNames AS Keywords

Source: Chuck Dearbeck

Recommended Links...