title: Insert into SQL Server DB statement Date Conversion
body: <p>I have this insert statement that is failing, throwing this error:</p>
  
  <blockquote>
    <p>Msg 242, Level 16, State 3, Line 1<br>
    The conversion of a varchar data type to a datetime data type resulted in an out-of-range value. The statement has been terminated.</p>
  </blockquote>
  
  <p>Here is the insert statement:</p>
  
  <pre><code>INSERT INTO JOBR_GENERIC (ID, NUM_ATTR1, STR_ATTR1, TYPE, PLANT_ID,
                            MATERIAL_NUMBER, ORDERNO, LOTNO, QTY, DATE_ATTR1, 
                            STR_ATTR2, NUM_ATTR2, NUM_ATTR3, NUM_ATTR4, 
                            STR_ATTR3, NUM_ATTR5, NUM_ATTR6, NUM_ATTR7, 
                            NUM_ATTR9, NUM_ATTR10, NUM_ATTR11, DATE_ATTR2, 
                            DATE_ATTR3, DATE_ATTR4, NUM_ATTR12, NUM_ATTR13, STR_ATTR4, JOBR_TS) 
  VALUES (153322, 401129, '901', 'A', 'A85', 
          '8ALD160', '', '6666666A', 8, CONVERT(DATETIME, '24/06/2017 00:00:00', 120),  
          'Test', 1, 9, 1, 
          '', 36, 99999999, 0, 
          109, 0, 0, CONVERT(DATETIME, '15/06/2018 16:08:26:397', 120), 
          CONVERT (DATETIME, '15/06/2018 16:08:26:397', 120), CONVERT(DATETIME, '', 120), 0, 0, 
          'A85', CONVERT(DATETIME, '2018-07-05 12:31:34', 120))
  </code></pre>