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,245
  • 3
  • 25
  • 46

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
  • 69,699
  • 7
  • 57
  • 89