title: MS SQL does not allow VARCHAR over 128 characters, why?
body: <p>I have a table with a column configured to hold <code>nvarchar</code> data type.
  I am trying to add a row using </p>
  
  <pre><code>INSERT INTO TABLE_NAME VALUES (value1, value2...)
  </code></pre>
  
  <p>Sql-server gets stuck on a 180 character string that I am trying to assign to the <code>nvarchar</code> data type column returning: </p>
  
  <blockquote>
    <p>Error: The identifier that starts with [part of string] is too long.
    Maximum length is 128.</p>
  </blockquote>
  
  <p>I don't understand why this is happening since nvarchar(max) should hold 2GByte of storage as I read here: <a href="https://stackoverflow.com/questions/11131958/what-is-the-maximum-characters-for-the-nvarcharmax">What is the maximum characters for the NVARCHAR(MAX)?</a></p>
  
  <p>Any ideas of what I've got wrong here?</p>
  
  <p><strong>UPDATE:</strong> </p>
  
  <p>The table was created with this: </p>
  
  <pre><code>CREATE TABLE MED_DATA (
      MED_DATA_ID INT
      ,ORDER_ID INT
      ,GUID NVARCHAR
      ,INPUT_TXT NVARCHAR
      ,STATUS_CDE CHAR
      ,CRTE_DTM DATETIME
      ,MOD_AT_DTM DATETIME
      ,CHG_IN_REC_IND CHAR
      ,PRIMARY KEY (MED_DATA_ID)
      )
  </code></pre>
  
  <p>And my actual INSERT statement is as follows:</p>
  
  <pre><code>INSERT INTO MED_DATA
  VALUES (
      5
      ,12
      ,"8fd9924"
      ,"{'firstName':'Foo','lastName':'Bar','guid':'8fd9924','weightChanged':false,'gender':'Male','heightFeet':9,'heightInches':9,'weightPounds':999}"
      ,"PENDING"
      ,"2017-09-02 00:00:00.000"
      ,"2017-09-02 00:00:00.000"
      ,NULL
      )
  </code></pre>