title: JSON text is not properly formatted. Unexpected character 'N' is found at position 0
body: <p>I am new to JSON in SQL. I am getting the error "JSON text is not properly formatted. Unexpected character 'N' is found at position 0." while executing the below -</p>
  
  <pre><code>DECLARE @json1 NVARCHAR(4000)
  set @json1 = N'{"name":[{"FirstName":"John","LastName":"Doe"}], "age":31, "city":"New York"}'
  DECLARE @v NVARCHAR(4000)
  set @v = CONCAT('N''',(SELECT value FROM OPENJSON(@json1, '$.name')),'''')
  --select @v as 'v'
  SELECT  JSON_VALUE(@v,'$.FirstName')
  </code></pre>
  
  <p>the " select @v as 'v' " gives me </p>
  
  <pre><code>N'{"FirstName":"John","LastName":"Doe"}'
  </code></pre>
  
  <p>But, using it in the last select statement gives me error.</p>
  
  <pre><code>DECLARE @v1 NVARCHAR(4000)
  set @v1 = N'{"FirstName":"John","LastName":"Doe"}'
  SELECT  JSON_VALUE(@v1,'$.FirstName') as 'FirstName'
  </code></pre>
  
  <p>also works fine.</p>