Home > Enterprise >  Add character after specific character in sql server
Add character after specific character in sql server

Time:10-16

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

CodePudding user response:

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

UPDATE yourTable
SET val = '['   REPLACE(val, '}{', '},{')   ']';
  • Related