Parse string to comma delimited words SQL Server

Is there a function i can use to parse a string in a table column to comma delimited words. E.G

ColumnC
'Quick brown fox'

ColumnB
'jumped over the lazy dog'

UPDATE TableA
set ColumnA = ColumnB + ' ' + ColumnC

 Results
'Quick brown fox jumped over the lazy dog'

I ll like the results to be: 'Quick,brown,fox,jumped, over,the,lazy,dog'
peterslove53Asked:
Who is Participating?
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
You can use REPLACE function:
UPDATE TableA
 set ColumnA = REPLACE(@ColumnC, ' ', ',') + REPLACE(@ColumnB, ' ', ',')

Open in new window

0
 
peterslove53Author Commented:
thank you very much Vitor Montalvão. that worked perfect.
0
 
peterslove53Author Commented:
Worked perfect. Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.