title: How to change column datatype in SQL Server and convert previous type without losing data
body: <p>I have a SQL Server database and I'd like to change column types to reduce it's size:</p>
  
  <ol>
  <li><p>I have a string Name <code>Varchar(100)</code> and want to convert it to <code>Varchar(50)</code> AND I have to move data to it (data will fit into <code>varchar(50)</code>)</p></li>
  <li><p>I have a <code>Varchar(30)</code> that represents time as epoch time (eg. <strong>1508752574</strong>). I want to change the type to <code>Datetime</code> and convert data form <code>Varchar(30)</code> to <code>Datetime</code> and then put it in <code>Datetime</code></p></li>
  </ol>
  
  <p>Can I do it without losing data?</p>