title: How to fix 'JSON text is not properly formatted. Unexpected character '\' is found at position 1.' error in SQL Server
body: <p>I need to pass a JSON to stored procedure as a string and then convert that sting JSON using OPENJSON. The input parameter need be in string format and it contains \ scape characters.  </p>
  
  <p>The open JSON is available in SQL Server 2016, I have tried using OPENJSON without '\', it is perfectly working </p>
  
  <p><strong>This code is working:</strong></p>
  
  <pre><code>DECLARE @test1 NVARCHAR(MAX)='{"name":"john","age":22,"class":"mca"}'
  SELECT * FROM OPENJSON(@test1)
  </code></pre>
  
  <p><strong>This is not working:</strong></p>
  
  <pre><code>DECLARE @test2 NVARCHAR(MAX)='{\"name\":\"john smith\",\"age\":22,\"class\":\"mca\"}'
  SELECT * FROM OPENJSON(@test2)
  </code></pre>