-3

I have a string and need to add character ',' after each character'}' and the string doesn't have fixed length

and need to add '[' in the start of text and ']' in the end of text

for example :

enter image description here

Barbaros Özhan
  • 59,113
  • 10
  • 31
  • 55
  • 2
    [Please do not upload images of code/data/errors when asking a question.](//meta.stackoverflow.com/q/285551) – Thom A Oct 16 '22 at 12:10

1 Answers1

2

We can use REPLACE() here along with a concatenation:

UPDATE yourTable
SET val = '[' + REPLACE(val, '}{', '},{') + ']';
Tim Biegeleisen
  • 502,043
  • 27
  • 286
  • 360