title: How to add property to JSON object in SQL Server column
body: <p>One of my table has JSON data in a SQL Server database. I need to add new property to  existing JSON. </p>
  
  <p>Example of JSON data in Table:</p>
  
  <pre><code>{ "FirstName": "John" }
  </code></pre>
  
  <p>What I need is to add another property to this column.</p>
  
  <pre><code>{ "FirstName": "Jonh","City":"Pune" }
  </code></pre>
  
  <p>I tried to use JSON_MODIFY function but it is throwing error. Does this work only with array?</p>
  
  <p>Code which I tried:</p>
  
  <pre><code>update &lt;TableName&gt; 
  set &lt;jsonColumnName&gt; = JSON_MODIFY(&lt;jsonColumnName&gt;, '$.', JSON_QUERY(N'{ "City":"Pune" }'))
  where UserId = 1
  </code></pre>
  
  <p>Error message:</p>
  
  <blockquote>
    <p>JSON path is not properly formatted. Unexpected character '.' is found at position 2.</p>
  </blockquote>