title: Converting NVARCHAR(255) to DATE
body: <p>I'm trying to transfer some old SQL Server data using Excel into SQL Server. It seems that <code>Import/Export Data</code> application automatically sets most data columns to <code>NVARCHAR(255)</code>. Problem I have, is one of my columns is supposed to be a <code>DATE</code> type, but all data in it looks like this <code>18.08.2000 14:48:15</code>. </p>
  
  <p>So, when I try to use this query:</p>
  
  <pre><code>SELECT CONVERT(Date, DATE_TIME,  113)
  FROM someTable
  </code></pre>
  
  <p>I get this error:</p>
  
  <blockquote>
    <p>Msg 9807, Level 16, State 0, Line 1<br>
    The input character string does not follow style 113, either change the input character string or use a different style.</p>
  </blockquote>
  
  <p>None of the <code>[styles]</code> from <a href="http://msdn.microsoft.com/en-us/library/ms187928.aspx" rel="noreferrer">CAST and CONVERT (Transact-SQL)</a> are working in my case.</p>
  
  <p>Any advise or help is greatly appreciated.</p>
  
  <p><strong>SOLVED:</strong></p>
  
  <pre><code>UPDATE myTable
  SET columnName = CONVERT(NVARCHAR(255),CONVERT(SMALLDATETIME, columnName,105))
  ALTER TABLE myTable
  ALTER COLUMN columnName SMALLDATETIME
  </code></pre>