title: SSIS - expression computation error when converting nchar empty string to int
body: <p>I have a nchar(10) field in the database which I try to transform to int in the SSIS package. </p>
  
  <p>The field contains 3 distinct values: empty string (<code>len(field)</code> in SSMS returns 0) and two numbers. In SSIS I have put the following expression on this field: </p>
  
  <pre><code>LEN(field) &gt; 0 ? (DT_I4)field : (DT_I4)0 
  </code></pre>
  
  <p>This, however fails with "DTS_E_EXPREVALSTATIC_COMPUTATIONFAILED" (-1073442796) error, but only for rows which contain empty string. To eliminate this issue, I used </p>
  
  <pre><code>LEN(TRIM(field)) &gt; 0 ? (DT_I4)field : (DT_I4)0
  </code></pre>
  
  <p>That worked, but why is this the case? Why does it fail when len in SQL Server shows 0? Is this some problem with nchar/DT_WSTR?</p>