title: How to convert ISO 8601 utc time to datetime format in SQL server 2016
body: <p>I'm trying to import some data from a flat file into SQL SERVER 2016. In the flat file, there is a date data in ISO 8061 UTC format</p>
  
  <pre><code>eg: 2017-10-08T00:00:00.0000000Z
  </code></pre>
  
  <p>While creating the table in sql server, I created the column as datetime. But now when I try to do a select on this particular column it is throwing error as:</p>
  
  <pre><code>Expected data type: DATETIME NOT NULL, Offending value: 2017-10-08T00:00:00.0000000Z  (Column Conversion Error), Error: Conversion failed when converting the NVARCHAR value '2017-10-08T00:00:00.0000000Z' to data type DATETIME.
  </code></pre>
  
  <p>Is there anyway to resolve this. I tried the below statement in SQL server:</p>
  
  <pre><code>SELECT convert(datetime, DateColumnISO, 127) FROM myTable;
  </code></pre>
  
  <p>This again threw the same error.</p>
  
  <p>Thanks,
  Arjun</p>