title: Format json SQL using Replace command
body: <p>I want to change the format from r1 to r2 Using SQL Server</p>
  <p>r1 :[  [  [ 1, 1 ], [ 2, 2 ],  [ 3, 3 ],[ 4, 4 ]  ]  ]</p>
  <p>r2 (should be ) : (1 1, 2 2), (3 3, 4 4)</p>
  <p>ps: the r1 is a JSON coordinates (multilinestring) that this format is exactly stored in SQL.. the number that I put just for reduce the confusion,</p>
  <p>My code</p>
  <pre><code> declare @r1 varchar(max)= '[  [  [ 1, 1 ], [ 2, 2 ],  [ 3, 3 ],[ 4, 4 ]  ]  ]'
  declare @r2 varchar(max) = replace(replace(replace(@r1,' ',''), '[','('), ']',')')
  select @r2
  </code></pre>
  <p>the result doesn't give me the format that I need.</p>