title: How to read a JSON key name that starts with a $ sign in SQL
body: <p>I'm trying to read the contents of a JSON file and upload the values to a table in SQL Server.
  The JSON file has the below structure. I can read the channel,networkID and Val values without an issue. I'm unable to read the values for $oid and $numberlong field as they have a $ sign in front of the Key name.</p>
  <pre><code>{
    &quot;_id&quot;: {
      &quot;$oid&quot;: &quot;614bf089913b862dbb8100a8&quot;
    },
    &quot;channel&quot;: 255,
    &quot;networkID&quot;: &quot;70B3D54990FC4FE0&quot;,
    &quot;data&quot;: {
      &quot;val&quot;: 3.133,
      &quot;date&quot;: {
        &quot;$date&quot;: {
          &quot;$numberLong&quot;: &quot;1632368421289&quot;
        }
      }
    }
  }
  </code></pre>
  <p>I'm using the below SQL Server code to read the JSON file.</p>
  <pre><code>SELECT 
                    _id       
                  , channel   
                  , network 
                  , val       
                  , msgID     
                  , volt      
                  , date      
              FROM OPENJSON ( @Json )
              WITH (   
                            _id       nvarchar(100)   '$._id.oid',  
                            channel   INT             '$.channel',  
                            network   nvarchar(200)   '$.networkID',  
                            val       decimal(18,4)   '$.data.val',  
                            msgID     int             '$.data.msgID',  
                            volt      decimal(18,4)   '$.data.volt',  
                            date      varchar(10)     '$.data.date.date',  
                            [Transaction]  nvarchar(MAX)  
                            AS JSON
  </code></pre>
  <p>How should I reference the key when a $ sign is there in front of the Key name.</p>