0

I have Data in my table which comes like this

Attachements,A,B,C,D.

I just want make this

Attachements:A,B,C,D.

I have tried all the Left,right,LTRIM,RTRIM and Replace functions. this not to deal with spaces

mohan111
  • 8,633
  • 4
  • 28
  • 55

1 Answers1

4

To replace the first comma you can use:

DECLARE @str VARcHAR(100) = 'Attachements,A,B,C,D'

SELECT STUFF(@str, CHARINDEX(',', @str), 1, ':')
Giorgos Betsos
  • 71,379
  • 9
  • 63
  • 98