title: Error Code: 1406. Data too long for column - MySQL
body: <p>Error Code: 1406. Data too long for column </p>
  
  <pre><code>CREATE  TABLE `TEST` 
  (
  
    `idTEST` INT NOT NULL ,
  
    `TESTcol` VARCHAR(45) NULL ,
  
    PRIMARY KEY (`idTEST`) 
  );
  </code></pre>
  
  <p>Now <code>Insert</code> some values</p>
  
  <pre><code>INSERT INTO TEST
  VALUES
  (
      1,
      'Vikas'
  )
  
  select 
  
  SELECT * FROM TEST;
  </code></pre>
  
  <p>Inserting record more than the <code>length</code></p>
  
  <pre><code>INSERT INTO TEST
  VALUES
  (
      2,
      'Vikas Kumar Gupta Kratika Shukla Kritika Shukla'
  )
  </code></pre>
  
  <p>If we <code>select</code> the <code>length</code> </p>
  
  <pre><code>SELECT LENGTH('Vikas Kumar Gupta Kratika Shukla Kritika Shukla')
  
   '47'
  </code></pre>
  
  <p>And it is showing the error message </p>
  
  <p><strong>Error Code: 1406. Data too long for column</strong> </p>
  
  <p>But what is my expectation is, I want to insert at least first 45 characters in Table</p>
  
  <p>please let me know if the question is not clear.</p>
  
  <p>I know the cause of this error. I am trying to insert values more than the length of datatype.</p>
  
  <p>I want solution in MySQL as It is possible in <code>MS SQL</code>. So I hope it would also be in <strong>MySQL</strong>.</p>