title: Converting varchar values to decimal while handling NULLs and EMPTY strings as 0
body: <p>I have a column of varchar datatype populated with a mix of values such as 1.2, 5.33 while also having NULLs and EMPTY strings.
  I want to convert all the values to decimal while treating NULLs and EMPTY strings as 0.</p>
  
  <p>I can change the NULLs or EMPTY strings using the CONVERT function like below. Like this I replace the NULLs and EMPTY strings with a varhcar 0.</p>
  
  <pre><code>CASE WHEN Column1 = '' OR Column1= NULL THEN '0' ELSE Column1 END AS 'NewColumn1'
  </code></pre>
  
  <p>However what I want to do is to be able to then convert this data (output of NewColumn1) into decimal but when I place the CASE statement into a CONVERT or a CAST function I will have errors.</p>
  
  <p>I also tried the following.
  C<code>ONVERT(DECIMAL(10,4), ISNULL(Column1, '0'))</code> however it fails since here I am not handling the EMPTY strings.</p>
  
  <p>Any ideas how can I solve this problem.</p>