title: convert varchar(ddmmyyyy) to date format
body: <p>How can I convert, for example, ddmmyyyy which is a varchar(8) to date format(dd/mm/yyyy)?</p>
  
  <p>I have a stored procedure which accepts a date varchar(8) parameter. </p>
  
  <p>I want to convert it to date format before inserting into database.
  I tried to use</p>
  
  <pre><code>INSERT INTO mytable(createdDate) VALUES (CONVERT(date, CONVERT(varchar(8), @date), 106));
  </code></pre>
  
  <p>An error:</p>
  
  <pre><code>Conversion failed when converting date and/or time from character string.
  </code></pre>
  
  <p>createdDate column is type : date</p>