title: Error unable to convert data type nvarchar to float
body: <p>I have searched both this great forum and googled around but unable to resolve this.</p>
  
  <p>We have two tables (and trust me I have nothing to do with these tables). Both tables have a column called <code>eventId</code>.</p>
  
  <p>However, in one table, data type for <code>eventId</code> is <code>float</code> and in the other table, it is <code>nvarchar</code>.</p>
  
  <p>We are selecting from <code>table1</code> where <code>eventI</code> is defined as <code>float</code> and saving that Id into <code>table2</code> where <code>eventId</code> is defined as <code>nvarchar(50)</code>.</p>
  
  <p>As a result of descrepancy in data types, we are getting error converting datatype <code>nvarchar</code> to <code>float</code>.</p>
  
  <p>Without fooling around with the database, I would like to cast the <code>eventId</code> to get rid of this error.</p>
  
  <p>Any ideas what I am doing wrong with the code below?</p>
  
  <pre><code>SELECT 
      CAST(CAST(a.event_id AS NVARCHAR(50)) AS FLOAT) event_id_vre,
  </code></pre>